Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2019-02-11 22:38:24 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-02-11 22:38:24 +0300
commit704d9aa3688680f7bd310b04fb02d98c94540954 (patch)
tree4a3b37c3f2b49a776d169f2a6c66efb0bea63399 /nbxmpp/modules
parent988398bbd01453a314bbe47e2c6f65dbb0a84e46 (diff)
MUC: Parse ofrom and lower handler priority
The handler should run before decryption handlers
Diffstat (limited to 'nbxmpp/modules')
-rw-r--r--nbxmpp/modules/muc.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/nbxmpp/modules/muc.py b/nbxmpp/modules/muc.py
index 7c291b8..380918f 100644
--- a/nbxmpp/modules/muc.py
+++ b/nbxmpp/modules/muc.py
@@ -25,6 +25,7 @@ from nbxmpp.protocol import NS_MUC_REQUEST
from nbxmpp.protocol import NS_MUC_ADMIN
from nbxmpp.protocol import NS_MUC_OWNER
from nbxmpp.protocol import NS_CAPTCHA
+from nbxmpp.protocol import NS_ADDRESS
from nbxmpp.protocol import JID
from nbxmpp.protocol import Iq
from nbxmpp.protocol import Message
@@ -71,7 +72,7 @@ class MUC:
StanzaHandler(name='message',
callback=self._process_groupchat_message,
typ='groupchat',
- priority=11),
+ priority=6),
StanzaHandler(name='message',
callback=self._process_mediated_invite,
typ='normal',
@@ -160,11 +161,17 @@ class MUC:
def _process_groupchat_message(self, _con, stanza, properties):
properties.from_muc = True
properties.muc_nickname = properties.jid.getResource() or None
-
+
muc_user = stanza.getTag('x', namespace=NS_MUC_USER)
if muc_user is not None:
properties.muc_user = self._parse_muc_user(muc_user)
+ addresses = stanza.getTag('addresses', namespace=NS_ADDRESS)
+ if addresses is not None:
+ address = addresses.getTag('address', attrs={'type': 'ofrom'})
+ if address is not None:
+ properties.muc_ofrom = JID(address.getAttr('jid'))
+
@staticmethod
def _process_message(_con, stanza, properties):
muc_user = stanza.getTag('x', namespace=NS_MUC_USER)