Remove fingerprint from get_trust_for_jid, simply wrap the omemo lib method

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 508a1fe9
......@@ -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
......
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