Changeset 10019

Show
Ignore:
Timestamp:
07/25/08 00:13:37 (4 months ago)
Author:
js
Message:

Start autonegotiation when the user starts typing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chat_control.py

    r10016 r10019  
    11531153 
    11541154                # Enable encryption if needed 
     1155                self.no_autonegotiation = False 
    11551156                e2e_is_active = self.session and self.session.enable_encryption 
    11561157                self.gpg_is_active = False 
    11571158                gpg_pref = gajim.config.get_per('contacts', contact.jid, 
    11581159                        'gpg_enabled') 
    1159                 e2e_pref = gajim.config.get_per('accounts', self.account, 
    1160                         'autonegotiate_esessions') and \ 
    1161                         gajim.config.get_per('contacts', contact.jid, 
    1162                         'autonegotiate_esessions') 
    11631160 
    11641161                # try GPG first 
     
    11791176                        self.gpg_is_active, 
    11801177                        self.session and self.session.is_loggable(), True) 
    1181                 # then try E2E 
    1182                 # XXX: Once we have fallback to disco, remove notexistant check 
    1183                 elif not e2e_is_active and gajim.HAVE_PYCRYPTO and e2e_pref \ 
    1184                 and gajim.capscache.is_supported(contact, NS_ESESSION) \ 
    1185                 and not gajim.capscache.is_supported(contact, 'notexistant'): 
    1186                         self.begin_e2e_negotiation() 
    11871178 
    11881179                self.status_tooltip = gtk.Tooltips() 
     
    22612252                if textbuffer.get_char_count(): 
    22622253                        self.send_chatstate('composing', self.contact) 
     2254 
     2255                        e2e_is_active = self.session and \ 
     2256                                self.session.enable_encryption 
     2257                        e2e_pref = gajim.config.get_per('accounts', 
     2258                                self.account, 'autonegotiate_esessions') and \ 
     2259                                gajim.config.get_per('contacts', 
     2260                                self.contact.jid, 'autonegotiate_esessions') 
     2261                        # XXX: Once we have fallback to disco, remove 
     2262                        #      notexistant check 
     2263                        if not e2e_is_active and e2e_pref and \ 
     2264                        not self.no_autonegotiation and gajim.HAVE_PYCRYPTO \ 
     2265                        and e2e_pref and gajim.capscache.is_supported( 
     2266                        self.contact, NS_ESESSION) and not \ 
     2267                        gajim.capscache.is_supported(self.contact, 
     2268                        'notexistant'): 
     2269                                self.no_autonegotiation = True 
     2270                                self.begin_e2e_negotiation() 
    22632271                else: 
    22642272                        self.send_chatstate('active', self.contact)