diff src/memory/memory.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 4f747d7fde8c
children 9a50aa7feefb
line wrap: on
line diff
--- a/src/memory/memory.py	Tue Nov 05 22:41:45 2013 +0100
+++ b/src/memory/memory.py	Thu Nov 07 15:29:39 2013 +0100
@@ -723,9 +723,11 @@
         @param name: Name of the profile"""
         return self.params.deleteProfile(name)
 
-    def addToHistory(self, from_jid, to_jid, message, _type='chat', timestamp=None, profile="@NONE@"):
+    def addToHistory(self, from_jid, to_jid, message, _type='chat', extra=None, timestamp=None, profile="@NONE@"):
         assert profile != "@NONE@"
-        return self.storage.addToHistory(from_jid, to_jid, message, _type, timestamp, profile)
+        if extra is None:
+            extra = {}
+        return self.storage.addToHistory(from_jid, to_jid, message, _type, extra, timestamp, profile)
 
     def getHistory(self, from_jid, to_jid, limit=0, between=True, profile="@NONE@"):
         assert profile != "@NONE@"