Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjs <js-gajim@webkeks.org>2008-07-25 02:13:37 +0400
committerjs <js-gajim@webkeks.org>2008-07-25 02:13:37 +0400
commitdcfeafd0c6de022242660293c284c84057030fd2 (patch)
treed98230e0a853d566af3ad28c4f04535374b28439
parentffd0bb8b0b35bad726d2b284604763af1d951f78 (diff)
Start autonegotiation when the user starts typing.
-rw-r--r--src/chat_control.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/chat_control.py b/src/chat_control.py
index 8c58a094d..58c1af4dd 100644
--- a/src/chat_control.py
+++ b/src/chat_control.py
@@ -1152,14 +1152,11 @@ class ChatControl(ChatControlBase):
self.print_esession_details()
# Enable encryption if needed
+ self.no_autonegotiation = False
e2e_is_active = self.session and self.session.enable_encryption
self.gpg_is_active = False
gpg_pref = gajim.config.get_per('contacts', contact.jid,
'gpg_enabled')
- e2e_pref = gajim.config.get_per('accounts', self.account,
- 'autonegotiate_esessions') and \
- gajim.config.get_per('contacts', contact.jid,
- 'autonegotiate_esessions')
# try GPG first
if not e2e_is_active and gpg_pref and \
@@ -1178,12 +1175,6 @@ class ChatControl(ChatControlBase):
self._show_lock_image(self.gpg_is_active, 'GPG',
self.gpg_is_active,
self.session and self.session.is_loggable(), True)
- # then try E2E
- # XXX: Once we have fallback to disco, remove notexistant check
- elif not e2e_is_active and gajim.HAVE_PYCRYPTO and e2e_pref \
- and gajim.capscache.is_supported(contact, NS_ESESSION) \
- and not gajim.capscache.is_supported(contact, 'notexistant'):
- self.begin_e2e_negotiation()
self.status_tooltip = gtk.Tooltips()
@@ -2260,6 +2251,23 @@ class ChatControl(ChatControlBase):
self.kbd_activity_in_last_30_secs = True
if textbuffer.get_char_count():
self.send_chatstate('composing', self.contact)
+
+ e2e_is_active = self.session and \
+ self.session.enable_encryption
+ e2e_pref = gajim.config.get_per('accounts',
+ self.account, 'autonegotiate_esessions') and \
+ gajim.config.get_per('contacts',
+ self.contact.jid, 'autonegotiate_esessions')
+ # XXX: Once we have fallback to disco, remove
+ # notexistant check
+ if not e2e_is_active and e2e_pref and \
+ not self.no_autonegotiation and gajim.HAVE_PYCRYPTO \
+ and e2e_pref and gajim.capscache.is_supported(
+ self.contact, NS_ESESSION) and not \
+ gajim.capscache.is_supported(self.contact,
+ 'notexistant'):
+ self.no_autonegotiation = True
+ self.begin_e2e_negotiation()
else:
self.send_chatstate('active', self.contact)