From 2b633526264eb42a53ce3473ced096c1bcd54492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 25 Aug 2019 23:20:13 +0200 Subject: [PATCH] Remove fingerprint from get_trust_for_jid, simply wrap the omemo lib method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp_omemo/__init__.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 90fe7aa..2f901b3 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -392,8 +392,8 @@ class XEP_0384(BasePlugin): """ Fetches trust for JID. The returned dictionary will contain active and inactive devices. Each of these dict will contain device ids - as keys, and a dict with 'key', 'trust' and 'fingerprint' as - values that can also be None. + as keys, and a dict with 'key', 'trust' as values that can also be + None. Example: { @@ -401,7 +401,6 @@ class XEP_0384(BasePlugin): 123456: { 'key': bytes, 'trust': bool, - 'fingerprint': str, } } 'inactive': { @@ -410,14 +409,7 @@ class XEP_0384(BasePlugin): } """ - devices = self._omemo.getTrustForJID(jid.bare) - for trust in devices['active'].values(): - if trust is not None: - trust['fingerprint'] = fp_from_ik(trust['key']) - for trust in devices['inactive'].values(): - if trust is not None: - trust['fingerprint'] = fp_from_ik(trust['key']) - return devices + return self._omemo.getTrustForJID(jid.bare) def is_encrypted(self, msg: Message) -> bool: return msg.xml.find('{%s}encrypted' % OMEMO_BASE_NS) is not None