aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/roster/module.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2019-09-10 21:58:12 +0200
committerMarvin W <git@larma.de>2019-09-10 23:02:42 +0200
commitdd33f5f949248d87d34f399e8846d5ee5b8823d9 (patch)
tree4a84fdaea219710faeda5941d90497f509ac2767 /xmpp-vala/src/module/roster/module.vala
parent307f16cc86dd2b95aa02ab8a85110e4a2d5e7363 (diff)
downloaddino-dd33f5f949248d87d34f399e8846d5ee5b8823d9.tar.gz
dino-dd33f5f949248d87d34f399e8846d5ee5b8823d9.zip
Check roster push authorization
Diffstat (limited to 'xmpp-vala/src/module/roster/module.vala')
-rw-r--r--xmpp-vala/src/module/roster/module.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/roster/module.vala b/xmpp-vala/src/module/roster/module.vala
index 7a69abe9..0fa7911c 100644
--- a/xmpp-vala/src/module/roster/module.vala
+++ b/xmpp-vala/src/module/roster/module.vala
@@ -47,6 +47,10 @@ public class Module : XmppStreamModule, Iq.Handler {
public void on_iq_set(XmppStream stream, Iq.Stanza iq) {
StanzaNode? query_node = iq.stanza.get_subnode("query", NS_URI);
if (query_node == null) return;
+ if (!iq.from.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) {
+ warning("Received alledged roster push from %s, ignoring", iq.from.to_string());
+ return;
+ }
Flag flag = stream.get_flag(Flag.IDENTITY);
Item item = new Item.from_stanza_node(query_node.get_subnode("item", NS_URI));