Mercurial > libervia-backend
changeset 2731:a58e380c1c37
core (xmpp): set "to" attribute to <message> element when it's missing:
when missing, profile's full jid is used as "to" attribute. This way, "to" attribute can be retrieved later without having to check if it has been set or not.
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 27 Dec 2018 11:40:04 +0100 |
parents | b4c0a5bec729 |
children | e55f871fa9db |
files | sat/core/xmpp.py |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/core/xmpp.py Thu Dec 27 11:40:04 2018 +0100 +++ b/sat/core/xmpp.py Thu Dec 27 11:40:04 2018 +0100 @@ -867,6 +867,10 @@ .format(xml=message_elt.toXml()))) client = self.parent + + if not message_elt.hasAttribute(u'to'): + message_elt['to'] = client.jid.full() + message = {} subject = {} extra = {}