From 4ded34ebc95e92acab4a9ac760d91e500497bf80 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 14 May 2012 16:10:22 -0700 Subject: Add MUC events for room configuration changes. New events: groupchat_config_status muc::[room JID]::config_status --- sleekxmpp/plugins/xep_0045.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sleekxmpp') 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("" % self.xmpp.default_ns), self.handle_groupchat_presence)) self.xmpp.registerHandler(Callback('MUCMessage', MatchXMLMask("" % self.xmpp.default_ns), self.handle_groupchat_message)) self.xmpp.registerHandler(Callback('MUCSubject', MatchXMLMask("" % self.xmpp.default_ns), self.handle_groupchat_subject)) + self.xmpp.registerHandler(Callback('MUCConfig', MatchXMLMask("" % 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. """ -- cgit v1.2.3