Always have self.contact of a chat control point to the hightest
resource if none was specified. As it's still possible to start E2E when the only E2E-capable resource goes offline, this means that caps is definitely broken. (Yes, I verified it with a print contact.resource - it IS checked for the right contact!)
This commit is contained in:
parent
6bfdebf347
commit
0d9a73cde9
|
@ -139,6 +139,13 @@ class ChatControlBase(MessageControl):
|
|||
|
||||
def __init__(self, type_id, parent_win, widget_name, contact, acct,
|
||||
resource = None):
|
||||
if resource is None:
|
||||
# We very likely got a contact with a random resource.
|
||||
# This is bad, we need the highest for caps etc.
|
||||
contact = gajim.contacts. \
|
||||
get_contact_with_highest_priority(
|
||||
acct, contact.jid)
|
||||
|
||||
MessageControl.__init__(self, type_id, parent_win, widget_name,
|
||||
contact, acct, resource = resource);
|
||||
|
||||
|
|
|
@ -833,6 +833,7 @@ class Interface:
|
|||
ctrl = self.msg_win_mgr.get_control(jid, account)
|
||||
if ctrl:
|
||||
ctrl.set_session(None)
|
||||
ctrl.contact = highest
|
||||
|
||||
def handle_event_msgerror(self, account, array):
|
||||
#'MSGERROR' (account, (jid, error_code, error_msg, msg, time[, session]))
|
||||
|
|
Loading…
Reference in New Issue