diff options
author | Lance Stout <lancestout@gmail.com> | 2012-05-14 16:10:22 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-05-14 16:10:22 -0700 |
commit | 4ded34ebc95e92acab4a9ac760d91e500497bf80 (patch) | |
tree | 0271da35081277ef47fd6c45241fb79fd2eb0f67 | |
parent | e918a860281675fc19c2c09bcf120c883ac7575f (diff) | |
download | slixmpp-4ded34ebc95e92acab4a9ac760d91e500497bf80.tar.gz slixmpp-4ded34ebc95e92acab4a9ac760d91e500497bf80.tar.bz2 slixmpp-4ded34ebc95e92acab4a9ac760d91e500497bf80.tar.xz slixmpp-4ded34ebc95e92acab4a9ac760d91e500497bf80.zip |
Add MUC events for room configuration changes.
New events:
groupchat_config_status
muc::[room JID]::config_status
-rw-r--r-- | sleekxmpp/plugins/xep_0045.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py index 06764d05..7fbb3d43 100644 --- a/sleekxmpp/plugins/xep_0045.py +++ b/sleekxmpp/plugins/xep_0045.py @@ -128,6 +128,7 @@ class XEP_0045(BasePlugin): self.xmpp.registerHandler(Callback('MUCPresence', MatchXMLMask("<presence xmlns='%s' />" % self.xmpp.default_ns), self.handle_groupchat_presence)) self.xmpp.registerHandler(Callback('MUCMessage', MatchXMLMask("<message xmlns='%s' type='groupchat'><body/></message>" % self.xmpp.default_ns), self.handle_groupchat_message)) self.xmpp.registerHandler(Callback('MUCSubject', MatchXMLMask("<message xmlns='%s' type='groupchat'><subject/></message>" % self.xmpp.default_ns), self.handle_groupchat_subject)) + self.xmpp.registerHandler(Callback('MUCConfig', MatchXMLMask("<message xmlns='%s' type='groupchat'><x xmlns='http://jabber.org/protocol/muc#user'><status/></x></message>" % self.xmpp.default_ns), self.handle_config_change)) self.xmpp.registerHandler(Callback('MUCInvite', MatchXPath("{%s}message/{%s}x/{%s}invite" % ( self.xmpp.default_ns, 'http://jabber.org/protocol/muc#user', @@ -140,6 +141,11 @@ class XEP_0045(BasePlugin): if inv['from'] not in self.rooms.keys(): self.xmpp.event("groupchat_invite", inv) + def handle_config_change(self, msg): + """Handle a MUC configuration change (with status code).""" + self.xmpp.event('groupchat_config_status', msg) + self.xmpp.event('muc::%s::config_status' % msg['from'].bare , msg) + def handle_groupchat_presence(self, pr): """ Handle a presence in a muc. """ |