From 5d6b60be6868cc744001e29e442bb01153c47115 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sat, 30 Aug 2008 02:50:10 +0000 Subject: [PATCH] fix GPG mysteriously turning on when you open a chat window --- src/chat_control.py | 4 +++- src/common/connection_handlers.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 6583d601a..32ed371c7 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -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', '', diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 0f0f97884..be3ed8fdf 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -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':