Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
668:7bb50096d225 | 669:ffb716804580 |
---|---|
721 def deleteProfile(self, name): | 721 def deleteProfile(self, name): |
722 """Delete an existing profile | 722 """Delete an existing profile |
723 @param name: Name of the profile""" | 723 @param name: Name of the profile""" |
724 return self.params.deleteProfile(name) | 724 return self.params.deleteProfile(name) |
725 | 725 |
726 def addToHistory(self, from_jid, to_jid, message, _type='chat', timestamp=None, profile="@NONE@"): | 726 def addToHistory(self, from_jid, to_jid, message, _type='chat', extra=None, timestamp=None, profile="@NONE@"): |
727 assert profile != "@NONE@" | 727 assert profile != "@NONE@" |
728 return self.storage.addToHistory(from_jid, to_jid, message, _type, timestamp, profile) | 728 if extra is None: |
729 extra = {} | |
730 return self.storage.addToHistory(from_jid, to_jid, message, _type, extra, timestamp, profile) | |
729 | 731 |
730 def getHistory(self, from_jid, to_jid, limit=0, between=True, profile="@NONE@"): | 732 def getHistory(self, from_jid, to_jid, limit=0, between=True, profile="@NONE@"): |
731 assert profile != "@NONE@" | 733 assert profile != "@NONE@" |
732 return self.storage.getHistory(jid.JID(from_jid), jid.JID(to_jid), limit, between, profile) | 734 return self.storage.getHistory(jid.JID(from_jid), jid.JID(to_jid), limit, between, profile) |
733 | 735 |