Commit c5e02cfc authored by Yann Leboulanger's avatar Yann Leboulanger

[moparisthebest] Encrypt GPG message to recipient and to our own key so that...

[moparisthebest] Encrypt GPG message to recipient and to our own key so that we can decrypt it later and use carbon. Fixes #7616
parent 45c9f3a7
......@@ -313,9 +313,10 @@ class CommonConnection:
error = _('The contact\'s key (%s) does not match the key assigned '
'in Gajim.' % keyID[:8])
else:
myKeyID = gajim.config.get_per('accounts', self.name, 'keyid')
def encrypt_thread(msg, keyID, always_trust=False):
# encrypt message. This function returns (msgenc, error)
return self.gpg.encrypt(msg.encode('utf-8'), [keyID],
return self.gpg.encrypt(msg.encode('utf-8'), [keyID, myKeyID],
always_trust)
def _on_encrypted(output):
msgenc, error = output
......@@ -424,8 +425,6 @@ class CommonConnection:
if msgenc:
msg_iq.setTag(nbxmpp.NS_ENCRYPTED + ' x').setData(msgenc)
if self.carbons_enabled:
msg_iq.addChild(name='private', namespace=nbxmpp.NS_CARBONS)
msg_iq.addChild(name='no-permanent-storage',
namespace=nbxmpp.NS_MSG_HINTS)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment