core: fixed empty body error on new message
This commit is contained in:
parent
cbb28ffcff
commit
f3223d6ce0
1 changed files with 3 additions and 2 deletions
|
|
@ -109,9 +109,10 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
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)
|
||||
mess_body = e.children[0] if e.children else ""
|
||||
self.host.bridge.newMessage(message["from"], mess_body, 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)
|
||||
self.host.memory.addToHistory(jid.JID(message["from"]), jid.JID(message["to"]), mess_body, profile=self.parent.profile)
|
||||
break
|
||||
|
||||
class SatRosterProtocol(xmppim.RosterClientProtocol):
|
||||
|
|
|
|||
Loading…
Reference in a new issue