Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
2730:b4c0a5bec729 | 2731:a58e380c1c37 |
---|---|
865 log.warning(_( | 865 log.warning(_( |
866 u"received <message> with a wrong namespace: {xml}" | 866 u"received <message> with a wrong namespace: {xml}" |
867 .format(xml=message_elt.toXml()))) | 867 .format(xml=message_elt.toXml()))) |
868 | 868 |
869 client = self.parent | 869 client = self.parent |
870 | |
871 if not message_elt.hasAttribute(u'to'): | |
872 message_elt['to'] = client.jid.full() | |
873 | |
870 message = {} | 874 message = {} |
871 subject = {} | 875 subject = {} |
872 extra = {} | 876 extra = {} |
873 data = { | 877 data = { |
874 u"from": jid.JID(message_elt["from"]), | 878 u"from": jid.JID(message_elt["from"]), |