diff src/core/xmpp.py @ 669:ffb716804580

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;
author Goffi <goffi@goffi.org>
date Thu, 07 Nov 2013 15:29:39 +0100
parents 2a7185b8452c
children 0c84fb112d70
line wrap: on
line diff
--- a/src/core/xmpp.py	Tue Nov 05 22:41:45 2013 +0100
+++ b/src/core/xmpp.py	Thu Nov 07 15:29:39 2013 +0100
@@ -138,9 +138,9 @@
                 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)