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
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2022-04-12 22:53:11 +0300
committerlovetox <philipp@hoerist.com>2022-04-12 22:53:11 +0300
commit9650139b1668823aed6c4306827762472c618d26 (patch)
tree7fd6f199c0d7c70fc6dc667532394eba23517fbc
parent713cea57a668508cb66d875d29db4ac7d82ee6fc (diff)
[openpgp] Correctly write trust to database
-rw-r--r--openpgp/modules/openpgp.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/openpgp/modules/openpgp.py b/openpgp/modules/openpgp.py
index 979e423..3d05bb4 100644
--- a/openpgp/modules/openpgp.py
+++ b/openpgp/modules/openpgp.py
@@ -40,6 +40,7 @@ from gajim.common.modules.util import event_node
from openpgp.modules.util import ENCRYPTION_NAME
from openpgp.modules.util import NOT_ENCRYPTED_TAGS
from openpgp.modules.util import Key
+from openpgp.modules.util import Trust
from openpgp.modules.util import add_additional_data
from openpgp.modules.util import DecryptionFailed
from openpgp.modules.util import prepare_stanza
@@ -241,8 +242,11 @@ class OpenPGP(BaseModule):
log.info('Received OpenPGP message from: %s', properties.jid)
prepare_stanza(stanza, payload)
+ trust = self._contacts.get_trust(properties.jid.bare, fingerprint)
+
properties.encrypted = EncryptionData({'name': ENCRYPTION_NAME,
- 'fingerprint': fingerprint})
+ 'fingerprint': fingerprint,
+ 'trust': trust})
def encrypt_message(self, obj, callback):
keys = self._contacts.get_keys(obj.jid)
@@ -273,6 +277,9 @@ class OpenPGP(BaseModule):
self._fingerprint)
obj.encrypted = ENCRYPTION_NAME
+ obj.additional_data['encrypted'] = {
+ 'name': ENCRYPTION_NAME,
+ 'trust': Trust.VERIFIED}
callback(obj)
@staticmethod