From 298ba4d9399b437f749b391371497f717d6d6d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 4 Apr 2017 23:21:11 +0200 Subject: [PATCH] Fix Last Message Correction for PGP messages --- src/common/connection.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/connection.py b/src/common/connection.py index 81d50ddde..882a42579 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -369,6 +369,13 @@ class CommonConnection: if obj.xhtml: obj.correction_msg.setXHTML(obj.xhtml) + if msgenc: + encrypted_tag = obj.correction_msg.getTag( + 'x', namespace=nbxmpp.NS_ENCRYPTED) + obj.correction_msg.delChild(encrypted_tag) + obj.correction_msg.setTag( + 'x', namespace=nbxmpp.NS_ENCRYPTED).setData(msgenc) + if obj.session: obj.session.last_send = time.time() @@ -398,7 +405,7 @@ class CommonConnection: msg_iq.setID(obj.msg_id) if msgenc: - msg_iq.setTag(nbxmpp.NS_ENCRYPTED + ' x').setData(msgenc) + msg_iq.setTag('x', namespace=nbxmpp.NS_ENCRYPTED).setData(msgenc) if obj.form_node: msg_iq.addChild(node=obj.form_node)