Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pgp
diff options
context:
space:
mode:
authorPhilipp Hörist <forenjunkie@chello.at>2018-07-15 02:40:28 +0300
committerPhilipp Hörist <forenjunkie@chello.at>2018-07-15 02:40:28 +0300
commit4fee27c26452fe8ede2cf8df8099862c95f4c1ba (patch)
treeb9b7b60676e0819213b42b0c7b9b373df6ad7ea6 /pgp
parent3f4ae27ae80cd84aed512fdb53c753f5e03eb623 (diff)
[pgp] Prepare for future Gajim changes
Diffstat (limited to 'pgp')
-rw-r--r--pgp/pgpplugin.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pgp/pgpplugin.py b/pgp/pgpplugin.py
index 652a3fe..1c6478e 100644
--- a/pgp/pgpplugin.py
+++ b/pgp/pgpplugin.py
@@ -29,8 +29,7 @@ from gi.repository import GLib
from gajim import dialogs
from gajim.common import app
-from gajim.common.connection_handlers_events import (
- MessageNotSentEvent, MessageReceivedEvent, MamMessageReceivedEvent)
+from gajim.common.connection_handlers_events import MessageNotSentEvent
from gajim.plugins import GajimPlugin
log = logging.getLogger('gajim.plugin_system.oldpgp')
@@ -147,10 +146,15 @@ class OldPGPPlugin(GajimPlugin):
# Another Plugin already decrypted the message
return
account = conn.name
- if isinstance(obj, MessageReceivedEvent):
+ if obj.name == 'message-received':
enc_tag = obj.stanza.getTag('x', namespace=nbxmpp.NS_ENCRYPTED)
- elif isinstance(obj, MamMessageReceivedEvent):
- enc_tag = obj.msg_.getTag('x', namespace=nbxmpp.NS_ENCRYPTED)
+ elif obj.name == 'mam-message-received':
+ # Compatibility for Gajim 1.0.3
+ if hasattr(obj, 'message'):
+ message = obj.message
+ else:
+ message = obj.msg_
+ enc_tag = message.getTag('x', namespace=nbxmpp.NS_ENCRYPTED)
else:
return
if enc_tag: