summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2014-02-06 09:19:24 -0800
committerLance Stout <lancestout@gmail.com>2014-02-06 09:19:24 -0800
commit7e1587faa28067b635068282acf4affe7a97e2ea (patch)
treec1fcd6c289430846de25d4e15a42b7a166e30321 /sleekxmpp/plugins
parent84a6ed8e804306df1a8fcd77cc4c03c5122a4abb (diff)
parenteb6ac68d5c8f323ef7036a4daf4e3cc0e55bfc85 (diff)
downloadslixmpp-7e1587faa28067b635068282acf4affe7a97e2ea.tar.gz
slixmpp-7e1587faa28067b635068282acf4affe7a97e2ea.tar.bz2
slixmpp-7e1587faa28067b635068282acf4affe7a97e2ea.tar.xz
slixmpp-7e1587faa28067b635068282acf4affe7a97e2ea.zip
Merge pull request #277 from allan-simon/develop
close #276, now we trigger 'groupchat_message_error'
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0045.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0045.py b/sleekxmpp/plugins/xep_0045.py
index 6e3f10a9..9587fa1a 100644
--- a/sleekxmpp/plugins/xep_0045.py
+++ b/sleekxmpp/plugins/xep_0045.py
@@ -126,6 +126,7 @@ class XEP_0045(BasePlugin):
# load MUC support in presence stanzas
register_stanza_plugin(Presence, MUCPresence)
self.xmpp.register_handler(Callback('MUCPresence', MatchXMLMask("<presence xmlns='%s' />" % self.xmpp.default_ns), self.handle_groupchat_presence))
+ self.xmpp.register_handler(Callback('MUCError', MatchXMLMask("<message xmlns='%s' type='error'><error/></message>" % self.xmpp.default_ns), self.handle_groupchat_error_message))
self.xmpp.register_handler(Callback('MUCMessage', MatchXMLMask("<message xmlns='%s' type='groupchat'><body/></message>" % self.xmpp.default_ns), self.handle_groupchat_message))
self.xmpp.register_handler(Callback('MUCSubject', MatchXMLMask("<message xmlns='%s' type='groupchat'><subject/></message>" % self.xmpp.default_ns), self.handle_groupchat_subject))
self.xmpp.register_handler(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))
@@ -179,6 +180,14 @@ class XEP_0045(BasePlugin):
self.xmpp.event('groupchat_message', msg)
self.xmpp.event("muc::%s::message" % msg['from'].bare, msg)
+ def handle_groupchat_error_message(self, msg):
+ """ Handle a message error event in a muc.
+ """
+ self.xmpp.event('groupchat_message_error', msg)
+ self.xmpp.event("muc::%s::message_error" % msg['from'].bare, msg)
+
+
+
def handle_groupchat_subject(self, msg):
""" Handle a message coming from a muc indicating
a change of subject (or announcing it when joining the room)