comparison src/sat.tac @ 264:27bc5d7732a3

core: fixed default message type
author Goffi <goffi@goffi.org>
date Sun, 23 Jan 2011 14:14:47 +0100
parents af3d4f11fe43
children c4b84a2d2ad1
comparison
equal deleted inserted replaced
263:bfd01aed0a3a 264:27bc5d7732a3
138 debug (_(u"got message from: %s"), message["from"]) 138 debug (_(u"got message from: %s"), message["from"])
139 if not self.host.trigger.point("MessageReceived",message, profile=self.parent.profile): 139 if not self.host.trigger.point("MessageReceived",message, profile=self.parent.profile):
140 return 140 return
141 for e in message.elements(): 141 for e in message.elements():
142 if e.name == "body": 142 if e.name == "body":
143 type = message['type'] if message.hasAttribute('type') else 'chat' #FIXME: check specs 143 mess_type = message['type'] if message.hasAttribute('type') else 'normal'
144 self.host.bridge.newMessage(message["from"], e.children[0], type, profile=self.parent.profile) 144 self.host.bridge.newMessage(message["from"], e.children[0], mess_type, profile=self.parent.profile)
145 self.host.memory.addToHistory(self.parent.jid, jid.JID(message["from"]), self.parent.jid, "chat", e.children[0]) 145 self.host.memory.addToHistory(self.parent.jid, jid.JID(message["from"]), self.parent.jid, "chat", e.children[0])
146 break 146 break
147 147
148 class SatRosterProtocol(xmppim.RosterClientProtocol): 148 class SatRosterProtocol(xmppim.RosterClientProtocol):
149 149