From 67fb5fe4c3b0d002e7f2d6659364d2da7f6e53a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 29 May 2020 17:43:45 +0200 Subject: [PATCH] XEP-0045: register_stanza_plgin(Message, MUCMessage) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp/plugins/xep_0045/__init__.py | 2 +- slixmpp/plugins/xep_0045/muc.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/slixmpp/plugins/xep_0045/__init__.py b/slixmpp/plugins/xep_0045/__init__.py index 75da0ca2..eb13b018 100644 --- a/slixmpp/plugins/xep_0045/__init__.py +++ b/slixmpp/plugins/xep_0045/__init__.py @@ -9,6 +9,6 @@ from slixmpp.plugins import register_plugin from slixmpp.plugins.xep_0045 import stanza from slixmpp.plugins.xep_0045.muc import XEP_0045 -from slixmpp.plugins.xep_0045.stanza import MUCPresence +from slixmpp.plugins.xep_0045.stanza import MUCPresence, MUCMessage register_plugin(XEP_0045) diff --git a/slixmpp/plugins/xep_0045/muc.py b/slixmpp/plugins/xep_0045/muc.py index c85779d1..364c47fd 100644 --- a/slixmpp/plugins/xep_0045/muc.py +++ b/slixmpp/plugins/xep_0045/muc.py @@ -19,7 +19,7 @@ from slixmpp.xmlstream.matcher.xmlmask import MatchXMLMask from slixmpp.exceptions import IqError, IqTimeout from slixmpp.plugins.xep_0045 import stanza -from slixmpp.plugins.xep_0045.stanza import MUCPresence +from slixmpp.plugins.xep_0045.stanza import MUCPresence, MUCMessage log = logging.getLogger(__name__) @@ -42,6 +42,7 @@ class XEP_0045(BasePlugin): self.xep = '0045' # load MUC support in presence stanzas register_stanza_plugin(Presence, MUCPresence) + register_stanza_plugin(Message, MUCMessage) self.xmpp.register_handler(Callback('MUCPresence', MatchXMLMask("" % self.xmpp.default_ns), self.handle_groupchat_presence)) self.xmpp.register_handler(Callback('MUCError', MatchXMLMask("" % self.xmpp.default_ns), self.handle_groupchat_error_message)) self.xmpp.register_handler(Callback('MUCMessage', MatchXMLMask("" % self.xmpp.default_ns), self.handle_groupchat_message))