comparison sat_frontends/bridge/dbus_bridge.py @ 2646:712cb4ff3e13

core: new EncryptionHandler class which manage encrypted session as a core feature: Plugin handling encryption can now register using host.registerEncryptionPlugin, and an encryption session can now be started using messageEncryptionStart bridge method. This will make encryption handling more easy, as we now know if a session is clear or e2e encrypted, and which plugin handle it.
author Goffi <goffi@goffi.org>
date Sun, 29 Jul 2018 19:22:56 +0200
parents 779351da2c13
children 4e130cc9bfc0
comparison
equal deleted inserted replaced
2645:f2cf1daa42cb 2646:712cb4ff3e13
502 kwargs['timeout'] = const_TIMEOUT 502 kwargs['timeout'] = const_TIMEOUT
503 kwargs['reply_handler'] = callback 503 kwargs['reply_handler'] = callback
504 kwargs['error_handler'] = error_handler 504 kwargs['error_handler'] = error_handler
505 return self.db_core_iface.menusGet(language, security_limit, **kwargs) 505 return self.db_core_iface.menusGet(language, security_limit, **kwargs)
506 506
507 def messageEncryptionStart(self, to_jid, encryption_ns='', profile_key="@NONE@", callback=None, errback=None):
508 if callback is None:
509 error_handler = None
510 else:
511 if errback is None:
512 errback = log.error
513 error_handler = lambda err:errback(dbus_to_bridge_exception(err))
514 kwargs={}
515 if callback is not None:
516 kwargs['timeout'] = const_TIMEOUT
517 kwargs['reply_handler'] = callback
518 kwargs['error_handler'] = error_handler
519 return self.db_core_iface.messageEncryptionStart(to_jid, encryption_ns, profile_key, **kwargs)
520
507 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): 521 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
508 if callback is None: 522 if callback is None:
509 error_handler = None 523 error_handler = None
510 else: 524 else:
511 if errback is None: 525 if errback is None: