comparison src/core/xmpp.py @ 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 8b891f9be183
children f71a0fc26886
comparison
equal deleted inserted replaced
1275:54a898821740 1276:56adf73bedeb
112 def __init__(self, host): 112 def __init__(self, host):
113 xmppim.MessageProtocol.__init__(self) 113 xmppim.MessageProtocol.__init__(self)
114 self.host = host 114 self.host = host
115 115
116 def onMessage(self, message): 116 def onMessage(self, message):
117 if not message.hasAttribute('from'):
118 message['from'] = self.parent.jid.host
117 log.debug(_(u"got message from: %s") % message["from"]) 119 log.debug(_(u"got message from: %s") % message["from"])
118 post_treat = defer.Deferred() # XXX: plugin can add their treatments to this deferred 120 post_treat = defer.Deferred() # XXX: plugin can add their treatments to this deferred
119 121
120 if not self.host.trigger.point("MessageReceived", message, post_treat, profile=self.parent.profile): 122 if not self.host.trigger.point("MessageReceived", message, post_treat, profile=self.parent.profile):
121 return 123 return