diff options
author | Philipp Hörist <philipp@hoerist.com> | 2019-07-05 23:43:58 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2019-07-05 23:43:58 +0300 |
commit | 1795473b5d699be0b95b511b0b7d03a8ca0ec348 (patch) | |
tree | 92423db9f2032266fcfbef687c10dcaee1858114 /nbxmpp/modules | |
parent | f39d00575910ec270f1d668e1f80edcc48cc5734 (diff) |
Add muc_jid attribute to Message and Presence
Attribute contains a bare JID object if the Message or Presence is from a MUC
Diffstat (limited to 'nbxmpp/modules')
-rw-r--r-- | nbxmpp/modules/muc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nbxmpp/modules/muc.py b/nbxmpp/modules/muc.py index a4f35be..3516287 100644 --- a/nbxmpp/modules/muc.py +++ b/nbxmpp/modules/muc.py @@ -97,6 +97,8 @@ class MUC: if muc is None: return properties.from_muc = True + properties.muc_jid = properties.jid.copy() + properties.muc_jid.setBare() properties.muc_nickname = properties.jid.getResource() def _process_muc_user_presence(self, _con, stanza, properties): @@ -104,6 +106,8 @@ class MUC: if muc_user is None: return properties.from_muc = True + properties.muc_jid = properties.jid.copy() + properties.muc_jid.setBare() destroy = muc_user.getTag('destroy') if destroy is not None: @@ -158,6 +162,8 @@ class MUC: def _process_groupchat_message(self, _con, stanza, properties): properties.from_muc = True + properties.muc_jid = properties.jid.copy() + properties.muc_jid.setBare() properties.muc_nickname = properties.jid.getResource() or None muc_user = stanza.getTag('x', namespace=NS_MUC_USER) @@ -185,6 +191,8 @@ class MUC: return properties.from_muc = True + properties.muc_jid = properties.jid.copy() + properties.muc_jid.setBare() if not properties.jid.isBare: return @@ -249,6 +257,8 @@ class MUC: return properties.from_muc = True + properties.muc_jid = properties.jid.copy() + properties.muc_jid.setBare() data = {} @@ -291,6 +301,9 @@ class MUC: return properties.voice_request = VoiceRequest(form=data_form) + properties.from_muc = True + properties.muc_jid = properties.jid.copy() + properties.muc_jid.setBare() @call_on_response('_affiliation_received') def get_affiliation(self, jid, affiliation): |