core: don't save anymore delayed message in history
This commit is contained in:
parent
f1966d9692
commit
4b5b8b8368
1 changed files with 7 additions and 6 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue