aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2023-03-23 10:13:30 -0600
committerMarvin W <git@larma.de>2023-03-23 11:37:47 -0600
commitef8fb0e94ce79d5fde2943e433ad0422eb7f70ec (patch)
treead17b8462933a5ed28d63aba9639e5053f1773a5 /xmpp-vala
parent6690d8e4a497eb1f18b43d6147676e08bb298dde (diff)
downloaddino-ef8fb0e94ce79d5fde2943e433ad0422eb7f70ec.tar.gz
dino-ef8fb0e94ce79d5fde2943e433ad0422eb7f70ec.zip
Check sender of bookmark:1 updates
Diffstat (limited to 'xmpp-vala')
-rw-r--r--xmpp-vala/src/module/xep/0402_bookmarks2.vala10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/xep/0402_bookmarks2.vala b/xmpp-vala/src/module/xep/0402_bookmarks2.vala
index 406f37f4..d1e53e6e 100644
--- a/xmpp-vala/src/module/xep/0402_bookmarks2.vala
+++ b/xmpp-vala/src/module/xep/0402_bookmarks2.vala
@@ -68,6 +68,11 @@ public class Module : BookmarksProvider, XmppStreamModule {
}
private void on_pupsub_item(XmppStream stream, Jid jid, string id, StanzaNode? node) {
+ if (!jid.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) {
+ warning("Received alleged bookmarks:1 item from %s, ignoring", jid.to_string());
+ return;
+ }
+
Conference conference = parse_item_node(node, id);
Flag? flag = stream.get_flag(Flag.IDENTITY);
if (flag != null) {
@@ -77,6 +82,11 @@ public class Module : BookmarksProvider, XmppStreamModule {
}
private void on_pupsub_retract(XmppStream stream, Jid jid, string id) {
+ if (!jid.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) {
+ warning("Received alleged bookmarks:1 retract from %s, ignoring", jid.to_string());
+ return;
+ }
+
try {
Jid jid_parsed = new Jid(id);
Flag? flag = stream.get_flag(Flag.IDENTITY);