Commit 70e8b130 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

[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 731cea3b
......@@ -313,9 +313,11 @@ def _prepare_message(self, jid, msg, keyID, type_='chat', subject='',
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, [keyID], always_trust)
return self.gpg.encrypt(msg, [keyID, myKeyID],
always_trust)
def _on_encrypted(output):
msgenc, error = output
if error == 'NOT_TRUSTED':
......@@ -423,8 +425,6 @@ def _on_continue_message(self, type_, msg, msgtxt, original_message, fjid,
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