fix GPG mysteriously turning on when you open a chat window

This commit is contained in:
Brendan Taylor 2008-08-30 02:50:10 +00:00
parent 32b56a2328
commit 5d6b60be68
2 changed files with 5 additions and 3 deletions

View File

@ -1843,7 +1843,9 @@ class ChatControl(ChatControlBase):
msg = _('The following message was encrypted')
ChatControlBase.print_conversation_line(self, msg, 'status', '',
tim)
self._toggle_gpg()
# turn on OpenPGP if this was in fact a XEP-0027 encrypted message
if encrypted == 'xep27':
self._toggle_gpg()
elif not encrypted and self.gpg_is_active:
msg = _('The following message was NOT encrypted')
ChatControlBase.print_conversation_line(self, msg, 'status', '',

View File

@ -1741,7 +1741,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
tim = localtime(timegm(tim))
if xep_200_encrypted:
encrypted = True
encrypted = 'xep200'
try:
msg = session.decrypt_stanza(msg)
@ -1781,7 +1781,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
decmsg = self.gpg.decrypt(encmsg, keyID)
# \x00 chars are not allowed in C (so in GTK)
msgtxt = decmsg.replace('\x00', '')
encrypted = True
encrypted = 'xep27'
if mtype == 'error':
self.dispatch_error_message(msg, msgtxt, session, frm, tim)
elif mtype == 'groupchat':