Add docstring for get_trust_for_jid
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
179db446fe
commit
9d3915a27c
1 changed files with 22 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue