# HG changeset patch # User Goffi # Date 1534004695 -7200 # Node ID b8600f8130ace77c2440bdb4e17e313e6740c861 # Parent e7bfbded652a12ec8bb112aa803fbafcac953f13 core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet) diff -r e7bfbded652a -r b8600f8130ac sat/bridge/bridge_constructor/bridge_template.ini --- a/sat/bridge/bridge_constructor/bridge_template.ini Sat Aug 11 18:24:55 2018 +0200 +++ b/sat/bridge/bridge_constructor/bridge_template.ini Sat Aug 11 18:24:55 2018 +0200 @@ -54,6 +54,31 @@ - info_type: subtype for info messages doc_param_8=%(doc_profile)s +[messageEncryptionStarted] +type=signal +category=core +sig_in=sss +doc=A message encryption session has been started +doc_param_0=to_jid: JID of the recipient (bare jid if it's encrypted for all devices) +doc_param_1=encryption_data: [JSON_OBJ] data of the encryption algorithm used, encoded as a json object. + it always has the following keys: + - name: human readable name of the algorithm + - namespace: namespace of the encryption plugin + following keys are present if suitable: + - directed_devices: list or resource where session is encrypted +doc_param_2=%(doc_profile_key)s + +[messageEncryptionStopped] +type=signal +category=core +sig_in=sa{ss}s +doc=A message encryption session has been stopped +doc_param_0=to_jid: JID of the recipient (full jid if it's only stopped for one device) +doc_param_1=encryption_data: data of the encryption algorithm stopped, has a least following keys: + - name: human readable name of the algorithm + - namespace: namespace of the encryption plugin +doc_param_2=%(doc_profile_key)s + [presenceUpdate] type=signal category=core diff -r e7bfbded652a -r b8600f8130ac sat/bridge/dbus_bridge.py --- a/sat/bridge/dbus_bridge.py Sat Aug 11 18:24:55 2018 +0200 +++ b/sat/bridge/dbus_bridge.py Sat Aug 11 18:24:55 2018 +0200 @@ -154,6 +154,16 @@ pass @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, + signature='sss') + def messageEncryptionStarted(self, to_jid, encryption_data, profile_key): + pass + + @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, + signature='sa{ss}s') + def messageEncryptionStopped(self, to_jid, encryption_data, profile_key): + pass + + @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, signature='sdssa{ss}a{ss}sa{ss}s') def messageNew(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile): pass @@ -656,6 +666,12 @@ def entityDataUpdated(self, jid, name, value, profile): self.dbus_bridge.entityDataUpdated(jid, name, value, profile) + def messageEncryptionStarted(self, to_jid, encryption_data, profile_key): + self.dbus_bridge.messageEncryptionStarted(to_jid, encryption_data, profile_key) + + def messageEncryptionStopped(self, to_jid, encryption_data, profile_key): + self.dbus_bridge.messageEncryptionStopped(to_jid, encryption_data, profile_key) + def messageNew(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile): self.dbus_bridge.messageNew(uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile) diff -r e7bfbded652a -r b8600f8130ac sat/bridge/pb.py --- a/sat/bridge/pb.py Sat Aug 11 18:24:55 2018 +0200 +++ b/sat/bridge/pb.py Sat Aug 11 18:24:55 2018 +0200 @@ -119,6 +119,12 @@ def entityDataUpdated(self, jid, name, value, profile): self.sendSignal("entityDataUpdated", jid, name, value, profile) + def messageEncryptionStarted(self, to_jid, encryption_data, profile_key): + self.sendSignal("messageEncryptionStarted", to_jid, encryption_data, profile_key) + + def messageEncryptionStopped(self, to_jid, encryption_data, profile_key): + self.sendSignal("messageEncryptionStopped", to_jid, encryption_data, profile_key) + def messageNew(self, uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile): self.sendSignal("messageNew", uid, timestamp, from_jid, to_jid, message, subject, mess_type, extra, profile)