Author: js
Date: 2008-07-23 20:21:02 +0200 (Wed, 23 Jul 2008)
New Revision: 10012
Modified:
trunk/src/chat_control.py
trunk/src/gajim.py
Log:
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!)
Modified: trunk/src/chat_control.py
===================================================================
--- trunk/src/chat_control.py 2008-07-23 17:40:02 UTC (rev 10011)
+++ trunk/src/chat_control.py 2008-07-23 18:21:02 UTC (rev 10012)
@@ -139,6 +139,13 @@
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);
Modified: trunk/src/gajim.py
===================================================================
--- trunk/src/gajim.py 2008-07-23 17:40:02 UTC (rev 10011)
+++ trunk/src/gajim.py 2008-07-23 18:21:02 UTC (rev 10012)
@@ -833,6 +833,7 @@
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]))