changeset 1276:56adf73bedeb

core (xmpp): set missing "from" attribute of received messages to the server domain
author souliane <souliane@mailoo.org>
date Fri, 19 Dec 2014 11:42:45 +0100
parents 54a898821740
children 3a3e3014f9f8
files src/core/xmpp.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/xmpp.py	Fri Dec 19 11:41:23 2014 +0100
+++ b/src/core/xmpp.py	Fri Dec 19 11:42:45 2014 +0100
@@ -114,6 +114,8 @@
         self.host = host
 
     def onMessage(self, message):
+        if not message.hasAttribute('from'):
+            message['from'] = self.parent.jid.host
         log.debug(_(u"got message from: %s") % message["from"])
         post_treat = defer.Deferred() # XXX: plugin can add their treatments to this deferred