core, bridge: extra parameter is saved in history:
- added extra data in getHistory return value
- extra data is saved in database
/!\ WARNING: DATABASE SCHEMA HAS CHANGED /!\
to update sqlite database: ALTER TABLE history ADD COLUMN extra BLOB;
This commit is contained in:
parent
008e449e59
commit
8624c3c547
1 changed files with 30 additions and 21 deletions
|
|
@ -138,9 +138,9 @@ class SatMessageProtocol(xmppim.MessageProtocol):
|
|||
data['extra']['archive'] = str(timestamp)
|
||||
if data['type'] != 'groupchat': # XXX: we don't save delayed messages in history for groupchats
|
||||
#TODO: add delayed messages to history if they aren't already in it
|
||||
self.host.memory.addToHistory(jid.JID(data['from']), jid.JID(data['to']), data['body'], data['type'], timestamp, profile=self.parent.profile)
|
||||
self.host.memory.addToHistory(jid.JID(data['from']), jid.JID(data['to']), data['body'], data['type'], data['extra'], timestamp, profile=self.parent.profile)
|
||||
except IndexError:
|
||||
self.host.memory.addToHistory(jid.JID(data['from']), jid.JID(data['to']), data['body'], data['type'], profile=self.parent.profile)
|
||||
self.host.memory.addToHistory(jid.JID(data['from']), jid.JID(data['to']), data['body'], data['type'], data['extra'], profile=self.parent.profile)
|
||||
self.host.bridge.newMessage(data['from'], data['body'], data['type'], data['to'], data['extra'], profile=self.parent.profile)
|
||||
|
||||
post_treat.addCallback(after_treatments)
|
||||
|
|
|
|||
Loading…
Reference in a new issue