From 6f61f05377e529bd262bcf9b3f022b39ee9e0257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 11 Feb 2019 20:29:20 +0100 Subject: [PATCH] MAM: Detect nbxmpp supported encryptions --- gajim/common/modules/mam.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gajim/common/modules/mam.py b/gajim/common/modules/mam.py index 34eb04029..8f258b91a 100644 --- a/gajim/common/modules/mam.py +++ b/gajim/common/modules/mam.py @@ -164,14 +164,18 @@ class MAM: else: event = MamMessageReceivedEvent(None, **event_attrs) - app.plugin_manager.extension_point( - 'decrypt', self._con, event, self._decryption_finished) - - if not event.encrypted: - eme = parse_eme(event.message) - if eme is not None: - event.msgtxt = eme + if properties.is_encrypted: + event.additional_data['encrypted'] = properties.encrypted.additional_data self._decryption_finished(event) + else: + app.plugin_manager.extension_point( + 'decrypt', self._con, event, self._decryption_finished) + + if not event.encrypted: + eme = parse_eme(event.message) + if eme is not None: + event.msgtxt = eme + self._decryption_finished(event) raise nbxmpp.NodeProcessed