Commit ab4eeae9 authored by Nikolay Yakimov's avatar Nikolay Yakimov

[gotr] Fix AttibuteError bug in get_control

gotr expects fjid to be str, but it can be nbxmpp.JID. Converting to str
shouldn't hurt, although could as well call fjid.getStripped() instead
of gajim.get_jid_without_resource.

Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/gajim/common/", line 93, in raise_event
    if handler(*args, **kwargs):
  File "/home/livid/.local/share/gajim/plugins/gotr/", line 564, in handle_incoming_msg
    appdata={'thread':event.session.thread_id if event.session else None})
  File "/home/livid/.local/share/gajim/plugins/gotr/potr/", line 210, in receiveMessage
    self.crypto.handleAKE(message, appdata=appdata)
  File "/home/livid/.local/share/gajim/plugins/gotr/potr/", line 282, in handleAKE
    outMsg = self.ake.handleRevealSig(inMsg)
  File "/home/livid/.local/share/gajim/plugins/gotr/potr/", line 420, in handleRevealSig
  File "/home/livid/.local/share/gajim/plugins/gotr/potr/", line 316, in goEncrypted
  File "/home/livid/.local/share/gajim/plugins/gotr/potr/", line 313, in _wentEncrypted
  File "/home/livid/.local/share/gajim/plugins/gotr/", line 175, in setState
    OtrPlugin.update_otr(self.peer, self.user.accountname)
  File "/home/livid/.local/share/gajim/plugins/gotr/", line 521, in update_otr
    ctrl = cls.get_control(user, acc)
  File "/home/livid/.local/share/gajim/plugins/gotr/", line 535, in get_control
    gajim.get_jid_without_resource(fjid), account)
  File "/usr/lib64/python2.7/site-packages/gajim/common/", line 297, in get_jid_without_resource
    return jid.split('/')[0]
AttributeError: JID instance has no attribute 'split'
parent b299827a
......@@ -530,7 +530,7 @@ class OtrPlugin(GajimPlugin):
# otherwise try without the resource
ctrl = gajim.interface.msg_win_mgr.get_control(
gajim.get_jid_without_resource(fjid), account)
gajim.get_jid_without_resource(str(fjid)), account)
# but only use it when it's not a GC window
if ctrl and ctrl.TYPE_ID == TYPE_CHAT:
return ctrl
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment