comparison src/memory/memory.py @ 1221:5e5661ab5c81

memory: getHistory with limit=0 now returns an empty list, use limit=None to return all messages
author souliane <souliane@mailoo.org>
date Fri, 03 Oct 2014 12:43:59 +0200
parents d9c399ec5dd9
children e6e0ea4dc835
comparison
equal deleted inserted replaced
1220:f91e7028e2c3 1221:5e5661ab5c81
348 assert profile != C.PROF_KEY_NONE 348 assert profile != C.PROF_KEY_NONE
349 if extra is None: 349 if extra is None:
350 extra = {} 350 extra = {}
351 return self.storage.addToHistory(from_jid, to_jid, message, type_, extra, timestamp, profile) 351 return self.storage.addToHistory(from_jid, to_jid, message, type_, extra, timestamp, profile)
352 352
353 def getHistory(self, from_jid, to_jid, limit=0, between=True, profile=C.PROF_KEY_NONE): 353 def getHistory(self, from_jid, to_jid, limit=None, between=True, profile=C.PROF_KEY_NONE):
354 assert profile != C.PROF_KEY_NONE 354 assert profile != C.PROF_KEY_NONE
355 return self.storage.getHistory(jid.JID(from_jid), jid.JID(to_jid), limit, between, profile) 355 return self.storage.getHistory(jid.JID(from_jid), jid.JID(to_jid), limit, between, profile)
356 356
357 def _getLastResource(self, jid_s, profile_key): 357 def _getLastResource(self, jid_s, profile_key):
358 jid_ = jid.JID(jid_s) 358 jid_ = jid.JID(jid_s)