Mercurial > libervia-backend
changeset 2748:ec9445c04a36
core (xmpp): added "extra" argument to client.feedback
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 04 Jan 2019 11:13:31 +0100 |
parents | 6487b8855c9a |
children | 4b8271399f67 |
files | sat/core/xmpp.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/core/xmpp.py Fri Jan 04 09:26:57 2019 +0100 +++ b/sat/core/xmpp.py Fri Jan 04 11:13:31 2019 +0100 @@ -700,14 +700,18 @@ self.send(mess_data[u"xml"]) defer.returnValue(mess_data) - def feedback(self, to_jid, message): + def feedback(self, to_jid, message, extra=None): """Send message to frontends This message will be an info message, not recorded in history. It can be used to give feedback of a command @param to_jid(jid.JID): destinee jid @param message(unicode): message to send to frontends + @param extra(None, dict): extra data to use + in particular, info subtype can be specified with MESS_EXTRA_INFO """ + if extra is None: + extra = {} self.host_app.bridge.messageNew( uid=unicode(uuid.uuid4()), timestamp=time.time(), @@ -716,7 +720,7 @@ message={u"": message}, subject={}, mess_type=C.MESS_TYPE_INFO, - extra={}, + extra=extra, profile=self.profile, )