comparison sat/core/xmpp.py @ 2658:4e130cc9bfc0

core (memore/encryption): new methods and checks: Following methods are now available though bridge: - messageEncryptionStop - messageEncryptionGet: retrieve encryption data for a message session - encryptionPluginsGet: retrieve all registered encryption plugin Following methods are available for internal use: - getPlugins: retrieve registerd plugins - getNSFromName: retrieve namespace from plugin name - getBridgeData: serialise session data (to be used with bridge) - markAsEncrypted: mark message data as encrypted (to be set by encryption plugin in MessageReceived trigger) Behaviours improvments: - start and stop send messageEncryptionStarted and messageEncryptionStopped signals, and a message feedback - new "replace" arguments in start allows to replace a plugin if one is already running (instead of raising a ConflictError) - plugins declare themselves as "directed" (i.e. working with only one device at a time) or not. This is checked while dealing with jids, an exception is raised when a full jid is received for a non directed encryption. - use of new data_format (de)serialise
author Goffi <goffi@goffi.org>
date Sat, 11 Aug 2018 18:24:55 +0200
parents 3a8e7ec4648a
children 661f66d41215
comparison
equal deleted inserted replaced
2657:9190874a8ac5 2658:4e130cc9bfc0
59 # Key: (full_jid,message_id) Value: uid 59 # Key: (full_jid,message_id) Value: uid
60 self.conn_deferred = defer.Deferred() 60 self.conn_deferred = defer.Deferred()
61 self._progress_cb = {} # callback called when a progress is requested 61 self._progress_cb = {} # callback called when a progress is requested
62 # (key = progress id) 62 # (key = progress id)
63 self.actions = {} # used to keep track of actions for retrieval (key = action_id) 63 self.actions = {} # used to keep track of actions for retrieval (key = action_id)
64 self.encryption = encryption.EncryptionHandler(host_app) 64 self.encryption = encryption.EncryptionHandler(self)
65 65
66 ## initialisation ## 66 ## initialisation ##
67 67
68 @defer.inlineCallbacks 68 @defer.inlineCallbacks
69 def _callConnectionTriggers(self): 69 def _callConnectionTriggers(self):
917 try: 917 try:
918 data["extra"]["received_timestamp"] = data["received_timestamp"] 918 data["extra"]["received_timestamp"] = data["received_timestamp"]
919 data["extra"]["delay_sender"] = data["delay_sender"] 919 data["extra"]["delay_sender"] = data["delay_sender"]
920 except KeyError: 920 except KeyError:
921 pass 921 pass
922 if C.MESS_KEY_ENCRYPTION in data:
923 data[u"extra"][u"encrypted"] = C.BOOL_TRUE
922 if data is not None: 924 if data is not None:
923 self.host.bridge.messageNew( 925 self.host.bridge.messageNew(
924 data["uid"], 926 data["uid"],
925 data["timestamp"], 927 data["timestamp"],
926 data["from"].full(), 928 data["from"].full(),