Merge branch 'ad-mucjoin-component-event' into 'master'
XEP-0045: Add a groupchat_join MUC event for components See merge request poezio/slixmpp!98
This commit is contained in:
commit
2631b25e3e
1 changed files with 12 additions and 0 deletions
|
@ -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.
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue