From 97d655682c04f24fc6edc85e9d7480c62bf55db0 Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 27 Dec 2018 11:40:04 +0100 Subject: [PATCH] core (xmpp): set "to" attribute to 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. --- sat/core/xmpp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sat/core/xmpp.py b/sat/core/xmpp.py index 2af23135..b571f1d6 100644 --- a/sat/core/xmpp.py +++ b/sat/core/xmpp.py @@ -867,6 +867,10 @@ class SatMessageProtocol(xmppim.MessageProtocol): .format(xml=message_elt.toXml()))) client = self.parent + + if not message_elt.hasAttribute(u'to'): + message_elt['to'] = client.jid.full() + message = {} subject = {} extra = {}