Changeset 10012

Show
Ignore:
Timestamp:
07/23/08 20:21:02 (3 months ago)
Author:
js
Message:

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!)

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chat_control.py

    r10011 r10012  
    140140        def __init__(self, type_id, parent_win, widget_name, contact, acct, 
    141141        resource = None): 
     142                if resource is None: 
     143                        # We very likely got a contact with a random resource. 
     144                        # This is bad, we need the highest for caps etc. 
     145                        contact = gajim.contacts. \ 
     146                                get_contact_with_highest_priority( 
     147                                acct, contact.jid) 
     148 
    142149                MessageControl.__init__(self, type_id, parent_win, widget_name, 
    143150                        contact, acct, resource = resource); 
  • trunk/src/gajim.py

    r10011 r10012  
    834834                        if ctrl: 
    835835                                ctrl.set_session(None) 
     836                                ctrl.contact = highest 
    836837 
    837838        def handle_event_msgerror(self, account, array):