Philipp Hörist pushed to branch master at gajim / python-nbxmpp


Commits:
1c8159e1 by Philipp Hörist at 2024-09-04T20:10:49+02:00
fix: Pubsub: Don’t process pubsub events from full jids

Fixes #159

- - - - -


1 changed file:

- nbxmpp/modules/pubsub.py


Changes:

=====================================
nbxmpp/modules/pubsub.py
=====================================
@@ -30,6 +30,7 @@ from nbxmpp.namespaces import Namespace
 from nbxmpp.protocol import Iq
 from nbxmpp.protocol import Node
 from nbxmpp.structs import CommonResult
+from nbxmpp.structs import MessageProperties
 from nbxmpp.structs import PubSubEventData
 from nbxmpp.structs import StanzaHandler
 from nbxmpp.task import iq_request_task
@@ -47,11 +48,23 @@ class PubSub(BaseModule):
                           priority=15),
         ]
 
-    def _process_pubsub_base(self, _client, stanza, properties):
+    def _process_pubsub_base(
+        self,
+        _client,
+        stanza,
+        properties: MessageProperties
+    ):
         if properties.type not in (MessageType.HEADLINE, MessageType.NORMAL):
             return
 
         properties.pubsub = True
+
+        assert properties.jid is not None
+        if properties.jid.is_full:
+            self._log.warning('PubSub event from full jid %s', properties.jid)
+            self._log.warning(stanza)
+            return
+
         event = stanza.getTag('event', namespace=Namespace.PUBSUB_EVENT)
 
         delete = event.getTag('delete')



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/1c8159e11e16369ebb8c2620cc1282512fe5de20

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/1c8159e11e16369ebb8c2620cc1282512fe5de20
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to