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
path: root/src
diff options
context:
space:
mode:
authorjs <js-gajim@webkeks.org>2008-08-04 03:01:43 +0400
committerjs <js-gajim@webkeks.org>2008-08-04 03:01:43 +0400
commit9bb8f8c5e64497ca40fb7a048b7a31c10dcff8bc (patch)
treef59817811e1f3e553f4b61dc67a99e52c4b01253 /src
parent94a43a03fb36f030ffafd054225b0f4fafa675f0 (diff)
Make "This message is encrypted" bodies consistent.
Diffstat (limited to 'src')
-rw-r--r--src/common/connection.py7
-rw-r--r--src/common/stanza_session.py9
2 files changed, 10 insertions, 6 deletions
diff --git a/src/common/connection.py b/src/common/connection.py
index f555e412d..c2aff3488 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -1080,12 +1080,11 @@ class Connection(ConnectionHandlers):
#encrypt
msgenc, error = self.gpg.encrypt(msg, [keyID])
if msgenc and not error:
- msgtxt = '[This message is encrypted]'
+ 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
- msgtxt = _('[This message is *encrypted* (See :XEP:`27`]') +\
- ' ([This message is *encrypted* (See :XEP:`27`])'
+ # one in locale and one en
+ msgtxt = _(msgtxt) + ' (' + msgtxt + ')'
else:
# Encryption failed, do not send message
tim = localtime()
diff --git a/src/common/stanza_session.py b/src/common/stanza_session.py
index debdeda24..a9993017f 100644
--- a/src/common/stanza_session.py
+++ b/src/common/stanza_session.py
@@ -11,6 +11,7 @@ import time
import xmpp.c14n
import base64
+import os
XmlDsig = 'http://www.w3.org/2000/09/xmldsig#'
@@ -249,8 +250,12 @@ class EncryptedStanzaSession(StanzaSession):
c.NT.mac = base64.b64encode(self.hmac(self.km_s, m_content + \
crypto.encode_mpi(old_en_counter)))
- stanza.setBody(_('[This message is part of an encrypted session. '
- 'If you see this message, something went wrong.]'))
+ msgtxt = '[This message is part of an encrypted session. ' \
+ 'If you see this message, something went wrong.]'
+ lang = os.getenv('LANG')
+ if lang is not None and lang != 'en': # we're not english
+ msgtxt = _(msgtxt) + ' (' + msgtxt + ')'
+ stanza.setBody(msgtxt)
return stanza