comparison sat_frontends/bridge/pb.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
380 d.addCallback(callback) 380 d.addCallback(callback)
381 if errback is None: 381 if errback is None:
382 errback = self._generic_errback 382 errback = self._generic_errback
383 d.addErrback(errback) 383 d.addErrback(errback)
384 384
385 def messageEncryptionStart(self, to_jid, encryption_ns='', profile_key="@NONE@", callback=None, errback=None):
386 d = self.root.callRemote("messageEncryptionStart", to_jid, encryption_ns, profile_key)
387 if callback is not None:
388 d.addCallback(lambda dummy: callback())
389 if errback is None:
390 errback = self._generic_errback
391 d.addErrback(errback)
392
385 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): 393 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):
386 d = self.root.callRemote("messageSend", to_jid, message, subject, mess_type, extra, profile_key) 394 d = self.root.callRemote("messageSend", to_jid, message, subject, mess_type, extra, profile_key)
387 if callback is not None: 395 if callback is not None:
388 d.addCallback(lambda dummy: callback()) 396 d.addCallback(lambda dummy: callback())
389 if errback is None: 397 if errback is None: