From 78bd83766ccf473dfb1fab6662dbf8214465302d Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 17 Dec 2011 14:54:29 +0100 Subject: [PATCH] do not send message if GPG encryption fails. Fixes #7059 --- src/common/connection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index ed651303a..2067be7f0 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -318,6 +318,7 @@ class CommonConnection: original_message, fjid, resource, jid, xhtml, subject, chatstate, msg_id, label, forward_from, delayed, session, form_node, user_nick, keyID, callback) + return self._on_continue_message(type_, msg, msgtxt, original_message, fjid, resource, jid, xhtml, subject, msgenc, keyID, chatstate, msg_id, @@ -333,8 +334,8 @@ class CommonConnection: if msgenc and not error: msgtxt = '[This message is *encrypted* (See :XEP:`27`]' lang = os.getenv('LANG') - if lang is not None and lang != 'en': # we're not english - # one in locale and one en + if lang is not None and not lang.startswith('en'): + # we're not english: one in locale and one en msgtxt = _('[This message is *encrypted* (See :XEP:`27`]') + \ ' (' + msgtxt + ')' self._on_continue_message(type_, msg, msgtxt, original_message,