Revert r9928 and implement a workaround that allows real E2E checking.

This workaround will still work once fallback to disco is supported,
though it SHOULD be removed then as it's not necassary anymore then.

@bct: Now we only need to get rid of that password dialog :).
This commit is contained in:
js 2008-07-15 13:30:31 +00:00
parent a6dfa86ad0
commit cb29efd57e
1 changed files with 11 additions and 2 deletions

View File

@ -45,7 +45,7 @@ from common.contacts import GC_Contact
from common.logger import Constants
constants = Constants()
from common.rst_xhtml_generator import create_xhtml
from common.xmpp.protocol import NS_XHTML, NS_FILE, NS_MUC
from common.xmpp.protocol import NS_XHTML, NS_FILE, NS_MUC, NS_ESESSION
try:
import gtkspell
@ -1144,6 +1144,12 @@ class ChatControl(ChatControlBase):
self.session.loggable = gajim.config.get('log_encrypted_sessions')
self._show_lock_image(self.gpg_is_active, 'GPG', self.gpg_is_active, self.session and \
self.session.is_loggable(), self.session and self.session.verified_identity)
# then try E2E
# XXX: Once we have fallback to disco, remove notexistant check
elif not e2e_is_active 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()
@ -1806,7 +1812,10 @@ class ChatControl(ChatControlBase):
toggle_gpg_menuitem.set_active(self.gpg_is_active)
# disable esessions if we or the other client don't support them
if not gajim.HAVE_PYCRYPTO:
# XXX: Once we have fallback to disco, remove notexistant check
if not gajim.HAVE_PYCRYPTO or \
not gajim.capscache.is_supported(contact, NS_ESESSION) or \
gajim.capscache.is_supported(contact, 'notexistant'):
toggle_e2e_menuitem.set_sensitive(False)
else:
toggle_e2e_menuitem.set_active(e2e_is_active)