Changeset 10159

Show
Ignore:
Timestamp:
08/09/08 00:55:12 (4 months ago)
Author:
bct
Message:

correctly decide whether to autonegotiate after a session was replaced

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chat_control.py

    r10157 r10159  
    11541154 
    11551155                # Enable encryption if needed 
    1156                 self.no_autonegotiation = False 
    11571156                e2e_is_active = self.session and self.session.enable_encryption 
    11581157                self.gpg_is_active = False 
     
    23262325                                gajim.config.get_per('contacts', 
    23272326                                self.contact.jid, 'autonegotiate_esessions') 
     2327 
    23282328                        want_e2e = not e2e_is_active and not self.gpg_is_active \ 
    23292329                                and e2e_pref 
    23302330 
     2331                        already_negotiating = bool(self.session and \ 
     2332                                self.session.status) 
     2333 
    23312334                        # XXX: Once we have fallback to disco, remove 
    23322335                        #      notexistant check 
    2333                         if want_e2e and not self.no_autonegotiation \ 
    2334                         and gajim.HAVE_PYCRYPTO \ 
    2335                         and gajim.capscache.is_supported(self.contact, 
    2336                         NS_ESESSION) and not gajim.capscache.is_supported( 
    2337                         self.contact, 'notexistant'): 
     2336                        can_e2e = gajim.HAVE_PYCRYPTO and gajim.capscache. \ 
     2337                                is_supported(self.contact, NS_ESESSION) and \ 
     2338                                not gajim.capscache.is_supported(self.contact, 
     2339                                'notexistant') 
     2340 
     2341                        if want_e2e and not already_negotiating and can_e2e: 
    23382342                                self.begin_e2e_negotiation() 
    2339                                 self.no_autonegotiation = True 
    23402343                else: 
    23412344                        self.send_chatstate('active', self.contact) 
  • trunk/src/gajim.py

    r10145 r10159  
    817817                                        if (ji+'/'+resource) != str(sess.jid): 
    818818                                                continue 
    819                                         ctrl = sess.control 
    820                                         if ctrl: 
    821                                                 ctrl.no_autonegotiation = False 
    822819                                        if sess.enable_encryption: 
    823820                                                sess.terminate_e2e()