Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim

Commits:
1c7fb74f by Philipp Hörist at 2017-07-28T13:41:51+02:00
Stay compatible with future nbxmpp versions

- - - - -


2 changed files:

- src/common/connection_handlers_events.py
- src/common/helpers.py


Changes:

=====================================
src/common/connection_handlers_events.py
=====================================
--- a/src/common/connection_handlers_events.py
+++ b/src/common/connection_handlers_events.py
@@ -1062,20 +1062,21 @@ class MamMessageReceivedEvent(nec.NetworkIncomingEvent, 
HelperEvent):
         self.tim = localtime(timegm(tim))
         to_ = self.msg_.getAttr('to')
         if to_:
+            to_ = str(to_)
             to_ = gajim.get_jid_without_resource(to_)
         else:
             to_ = gajim.get_jid_from_account(account)
-        frm_ = gajim.get_jid_without_resource(self.msg_.getAttr('from'))
+        frm_ = gajim.get_jid_without_resource(str(self.msg_.getAttr('from')))
         self.msgtxt = self.msg_.getTagData('body')
         if to_ == gajim.get_jid_from_account(account):
             self.with_ = frm_
             self.direction = 'from'
             self.resource = gajim.get_resource_from_jid(
-                self.msg_.getAttr('from'))
+                str(self.msg_.getAttr('from')))
         else:
             self.with_ = to_
             self.direction = 'to'
-            self.resource = 
gajim.get_resource_from_jid(self.msg_.getAttr('to'))
+            self.resource = gajim.get_resource_from_jid(to_)
         self.enc_tag = self.msg_.getTag('x', namespace=nbxmpp.NS_ENCRYPTED)
         return True
 


=====================================
src/common/helpers.py
=====================================
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -112,7 +112,7 @@ def parse_jid(jidstring):
     """
     # This function comes from 
http://svn.twistedmatrix.com/cvs/trunk/twisted/words/protocols/jabber/jid.py
 
-    return prep(*decompose_jid(jidstring))
+    return prep(*decompose_jid(str(jidstring)))
 
 def idn_to_ascii(host):
     """



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1c7fb74f1080c64520ab9c9b6ec93f58c88f6791
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to