changeset c6dd7924cd4f in /home/hg/repos/gajim-plugins
author: lovetox <forenjunkie(a)chello.at>
branches:
details:gajim-plugins?cmd=changeset;node=c6dd7924cd4f
description: Dont handle incoming PGP messages
diffstat:
omemo/__init__.py | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diffs (46 lines):
diff -r 7f16cbf197bd -r c6dd7924cd4f omemo/__init__.py
--- a/omemo/__init__.py Tue Aug 23 01:05:47 2016 +0200
+++ b/omemo/__init__.py Thu Aug 25 19:25:23 2016 +0200
@@ -53,6 +53,7 @@
ERROR_MSG = ''
NS_HINTS = 'urn:xmpp:hints'
+NS_PGP = 'urn:xmpp:openpgp:0'
DB_DIR = gajim.gajimpaths.data_root
log = logging.getLogger('gajim.plugin_system.omemo')
@@ -234,6 +235,9 @@
-------
Return means that the Event is passed on to Gajim
"""
+ if msg.msg_.getTag('openpgp', namespace=NS_PGP):
+ return
+
omemo_encrypted_tag = msg.msg_.getTag('encrypted', namespace=NS_OMEMO)
if omemo_encrypted_tag:
account = msg.conn.name
@@ -274,14 +278,6 @@
if omemo_enabled:
msg.msgtxt = '**Unencrypted** ' + msg.msgtxt
- try:
- gui = self.ui_list[account].get(jid, None)
- if gui and gui.encryption_active():
- gui.plain_warning()
- except KeyError:
- log.debug('No Ui present for ' + jid +
- ', Ui Warning not shown')
-
@log_calls('OmemoPlugin')
def message_received(self, msg):
""" Handles an incoming message
@@ -297,6 +293,9 @@
-------
Return means that the Event is passed on to Gajim
"""
+ if msg.stanza.getTag('openpgp', namespace=NS_PGP):
+ return
+
if msg.stanza.getTag('encrypted', namespace=NS_OMEMO) and \
msg.mtype == 'chat':
account = msg.conn.name