From 14dc34b3fb46fba6a7bc1aeb92aa571321321224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 19 Nov 2017 19:29:13 +0100 Subject: [PATCH] [pgp] Adapt to Gajim MAM changes --- pgp/pgpplugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pgp/pgpplugin.py b/pgp/pgpplugin.py index 770827b..4610b2e 100644 --- a/pgp/pgpplugin.py +++ b/pgp/pgpplugin.py @@ -30,7 +30,7 @@ from gi.repository import GLib from gajim import dialogs from gajim.common import app from gajim.common.connection_handlers_events import ( - MessageNotSentEvent, MessageReceivedEvent) + MessageNotSentEvent, MessageReceivedEvent, MamMessageReceivedEvent) from gajim.plugins import GajimPlugin log = logging.getLogger('gajim.plugin_system.oldpgp') @@ -136,8 +136,10 @@ class OldPGPPlugin(GajimPlugin): account = conn.name if isinstance(obj, MessageReceivedEvent): enc_tag = obj.stanza.getTag('x', namespace=nbxmpp.NS_ENCRYPTED) - else: + elif isinstance(obj, MamMessageReceivedEvent): enc_tag = obj.msg_.getTag('x', namespace=nbxmpp.NS_ENCRYPTED) + else: + return if enc_tag: encmsg = enc_tag.getData() key_id = app.config.get_per('accounts', account, 'keyid')