diff --git a/src/chat_control.py b/src/chat_control.py index 2700d7a32..8eec4c678 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -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); diff --git a/src/gajim.py b/src/gajim.py index 764812c3a..5ccc1f0fb 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -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]))