summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLink Mauve <linkmauve@linkmauve.fr>2021-01-12 20:36:36 +0100
committerLink Mauve <linkmauve@linkmauve.fr>2021-01-12 20:36:36 +0100
commit2631b25e3e58311b9d101b4217f878fa375db974 (patch)
treef8e765451f587c4a24cb5208eb490c21acf19761
parentca465032e7438476ca87a1299b6ce00db322bd85 (diff)
parent2b11d81b861711810e4cc822866099a3df960778 (diff)
downloadslixmpp-2631b25e3e58311b9d101b4217f878fa375db974.tar.gz
slixmpp-2631b25e3e58311b9d101b4217f878fa375db974.tar.bz2
slixmpp-2631b25e3e58311b9d101b4217f878fa375db974.tar.xz
slixmpp-2631b25e3e58311b9d101b4217f878fa375db974.zip
Merge branch 'ad-mucjoin-component-event' into 'master'
XEP-0045: Add a groupchat_join MUC event for components See merge request poezio/slixmpp!98
-rw-r--r--slixmpp/plugins/xep_0045/muc.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0045/muc.py b/slixmpp/plugins/xep_0045/muc.py
index 7a600059..905e0f49 100644
--- a/slixmpp/plugins/xep_0045/muc.py
+++ b/slixmpp/plugins/xep_0045/muc.py
@@ -91,6 +91,14 @@ class XEP_0045(BasePlugin):
StanzaPath("presence/muc"),
self.handle_groupchat_presence,
))
+ if self.xmpp.is_component:
+ self.xmpp.register_handler(
+ Callback(
+ 'MUCPresenceJoin',
+ StanzaPath("presence/muc_join"),
+ self.handle_groupchat_join,
+ ))
+
self.xmpp.register_handler(
Callback(
'MUCError',
@@ -189,6 +197,10 @@ class XEP_0045(BasePlugin):
else:
self.client_handle_presence(pr)
+ def handle_groupchat_join(self, pr: Presence):
+ """Received a join presence (as a component)"""
+ self.xmpp.event('groupchat_join', pr)
+
def handle_groupchat_message(self, msg: Message) -> None:
""" Handle a message event in a muc.
"""