core: don't save anymore delayed message in history

This commit is contained in:
Goffi 2011-11-08 22:21:58 +01:00
commit 4b5b8b8368

View file

@ -105,13 +105,14 @@ class SatMessageProtocol(xmppim.MessageProtocol):
def onMessage(self, message):
debug (_(u"got message from: %s"), message["from"])
if not self.host.trigger.point("MessageReceived",message, profile=self.parent.profile):
return
return
for e in message.elements():
if e.name == "body":
mess_type = message['type'] if message.hasAttribute('type') else 'normal'
self.host.bridge.newMessage(message["from"], e.children[0], mess_type, message['to'], profile=self.parent.profile)
self.host.memory.addToHistory(jid.JID(message["from"]), jid.JID(message["to"]), e.children[0], profile=self.parent.profile)
break
if e.name == "body":
mess_type = message['type'] if message.hasAttribute('type') else 'normal'
self.host.bridge.newMessage(message["from"], e.children[0], mess_type, message['to'], profile=self.parent.profile)
if not u"delay" in [elem.name for elem in message.elements()]: #we don't save delayed messages in history
self.host.memory.addToHistory(jid.JID(message["from"]), jid.JID(message["to"]), e.children[0], profile=self.parent.profile)
break
class SatRosterProtocol(xmppim.RosterClientProtocol):