diff options
author | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-04 18:36:25 +0100 |
---|---|---|
committer | Link Mauve <linkmauve@linkmauve.fr> | 2020-12-04 18:36:25 +0100 |
commit | d660e447ee8c7635a84d030fd51963a177dd42ad (patch) | |
tree | 8721f685599deabf0c90e32db78f1129c6778df3 | |
parent | 5c5780503ac0adcc5dc62d89f1193b65de29c80d (diff) | |
parent | 70cf35e9bf2dbbc09653c97e70b27e00feaee935 (diff) | |
download | slixmpp-d660e447ee8c7635a84d030fd51963a177dd42ad.tar.gz slixmpp-d660e447ee8c7635a84d030fd51963a177dd42ad.tar.bz2 slixmpp-d660e447ee8c7635a84d030fd51963a177dd42ad.tar.xz slixmpp-d660e447ee8c7635a84d030fd51963a177dd42ad.zip |
Merge branch 'fix-reactions' into 'master'
XEP-0444: Fix session_bind()
See merge request poezio/slixmpp!73
-rw-r--r-- | slixmpp/plugins/xep_0444/reactions.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/slixmpp/plugins/xep_0444/reactions.py b/slixmpp/plugins/xep_0444/reactions.py index bfd12499..e65f5e8f 100644 --- a/slixmpp/plugins/xep_0444/reactions.py +++ b/slixmpp/plugins/xep_0444/reactions.py @@ -11,7 +11,7 @@ from slixmpp import JID from slixmpp.plugins import BasePlugin from slixmpp.stanza import Message from slixmpp.xmlstream import register_stanza_plugin -from slixmpp.xmlstream.matcher import MatchXMLMask +from slixmpp.xmlstream.matcher import StanzaPath from slixmpp.xmlstream.handler import Callback from slixmpp.plugins.xep_0444 import stanza @@ -25,13 +25,11 @@ class XEP_0444(BasePlugin): namespace = stanza.NS def plugin_init(self): - self.xmpp.register_handler( - Callback( - 'Reaction received', - MatchXMLMask('<message><reactions xmlns="urn:xmpp:reactions:0"/></message>'), - self._handle_reactions, - ) - ) + self.xmpp.register_handler(Callback( + 'Reaction received', + StanzaPath("message/reactions"), + self._handle_reactions, + )) register_stanza_plugin(Message, stanza.Reactions) register_stanza_plugin(stanza.Reactions, stanza.Reaction, iterable=True) @@ -40,7 +38,7 @@ class XEP_0444(BasePlugin): def plugin_end(self): self.xmpp.remove_handler('Reaction received') - self.xmpp['xep_0030'].remove_feature(stanza.NS) + self.xmpp['xep_0030'].del_feature(stanza.NS) def _handle_reactions(self, message: Message): self.xmpp.event('reactions', message) |