diff sat/core/xmpp.py @ 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 b35c84ea73cf
children df2bc2e704bc
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 = {}