core (bridge): new messageEncryptionStarted and messageEncryptionStopped signals (not used yet)

This commit is contained in:
Goffi 2018-08-11 18:24:55 +02:00
commit 64d502958f
3 changed files with 47 additions and 0 deletions

View file

@ -54,6 +54,31 @@ doc_param_7=extra: extra message information, can have data added by plugins and
- 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

View file

@ -153,6 +153,16 @@ class DbusObject(dbus.service.Object):
def entityDataUpdated(self, jid, name, value, profile):
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):
@ -656,6 +666,12 @@ class Bridge(object):
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)

View file

@ -119,6 +119,12 @@ class Bridge(object):
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)