diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index fb4a5d7..f97feb9 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -387,7 +387,28 @@ class XEP_0384(BasePlugin): def distrust(self, jid: JID, device_id: int, ik: bytes) -> None: self._omemo.distrust(jid.bare, device_id, ik) - def get_trust_for_jid(self, jid: JID) -> Dict[str, List[Optional[Tuple[bytes, bool, str]]]]: + def get_trust_for_jid(self, jid: JID) -> Dict[str, List[Optional[Dict[str, Any]]]]: + """ + 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. + + Example: + { + 'active': { + 123456: { + 'key': bytes, + 'trust': bool, + 'fingerprint': str, + } + } + 'inactive': { + 234567: None, + } + } + """ + devices = self._omemo.getTrustForJID(jid.bare) for trust in devices['active'].values(): if trust is not None: