core, bridge, quick_frontend: MUC private messages history management:

- history now store message type
    - sqlite3 storage: fixed resource management in getHistory
    - bridge: added message type in getHistory return value
    - quick_chats: (ugly) hacks to manage private history filtering/nickname printing
This commit is contained in:
Goffi 2012-10-17 00:35:48 +02:00
commit fef2b1a620
2 changed files with 52 additions and 30 deletions

View file

@ -499,7 +499,7 @@ class SAT(service.Service):
message.addElement("body", "jabber:client", mess_data["message"])
client.xmlstream.send(message)
if mess_data["type"]!="groupchat":
self.memory.addToHistory(current_jid, jid.JID(to), unicode(mess_data["message"]), profile=profile) #we don't add groupchat message to history, as we get them back
self.memory.addToHistory(current_jid, jid.JID(to), unicode(mess_data["message"]), unicode(mess_data["type"]), profile=profile) #we don't add groupchat message to history, as we get them back
#and they will be added then
self.bridge.newMessage(message['from'], unicode(mess_data["message"]), mess_type=mess_data["type"], to_jid=message['to'], profile=profile) #We send back the message, so all clients are aware of it

View file

@ -113,7 +113,7 @@ class SatMessageProtocol(xmppim.MessageProtocol):
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"]), mess_body, profile=self.parent.profile)
self.host.memory.addToHistory(jid.JID(message["from"]), jid.JID(message["to"]), mess_body, mess_type, profile=self.parent.profile)
break
class SatRosterProtocol(xmppim.RosterClientProtocol):