comparison sat/plugins/plugin_xep_0384.py @ 3236:9477f3197981

plugin XEP-0384: added resetTrust in OmemoSession
author Goffi <goffi@goffi.org>
date Fri, 27 Mar 2020 09:55:16 +0100
parents e756e0eb1be4
children b0c57c9a4bd8
comparison
equal deleted inserted replaced
3235:c161ff21ca7c 3236:9477f3197981
284 284
285 class SatOTPKPolicy(omemo.DefaultOTPKPolicy): 285 class SatOTPKPolicy(omemo.DefaultOTPKPolicy):
286 pass 286 pass
287 287
288 288
289 class OmemoSession(object): 289 class OmemoSession:
290 """Wrapper to use omemo.OmemoSession with Deferred""" 290 """Wrapper to use omemo.OmemoSession with Deferred"""
291 291
292 def __init__(self, session): 292 def __init__(self, session):
293 self._session = session 293 self._session = session
294 294
373 device=device, 373 device=device,
374 key=key, 374 key=key,
375 trusted=trusted, 375 trusted=trusted,
376 ) 376 )
377 return promise2Deferred(setTrust_p) 377 return promise2Deferred(setTrust_p)
378
379 def resetTrust(self, bare_jid, device):
380 bare_jid = bare_jid.userhost()
381 resetTrust_p = self._session.resetTrust(
382 bare_jid=bare_jid,
383 device=device,
384 )
385 return promise2Deferred(resetTrust_p)
378 386
379 def getTrustForJID(self, bare_jid): 387 def getTrustForJID(self, bare_jid):
380 bare_jid = bare_jid.userhost() 388 bare_jid = bare_jid.userhost()
381 get_trust_p = self._session.getTrustForJID(bare_jid=bare_jid) 389 get_trust_p = self._session.getTrustForJID(bare_jid=bare_jid)
382 return promise2Deferred(get_trust_p) 390 return promise2Deferred(get_trust_p)