memory: add Parameter "Chat history limit"

This commit is contained in:
souliane 2014-09-24 13:49:43 +02:00
commit 4f339272b7

View file

@ -265,10 +265,15 @@ class SqliteStorage(object):
return d
def getHistory(self, from_jid, to_jid, limit=None, between=True, profile=None):
"""Store a new message in history
@param from_jid: source JID (full, or bare for catchall
@param to_jid: dest JID (full, or bare for catchall
@param size: maximum number of messages to get, or None for unlimited
"""Retrieve messages in history
@param from_jid (JID): source JID (full, or bare for catchall)
@param to_jid (JID): dest JID (full, or bare for catchall)
@param limit (int): maximum number of messages to get:
- 0 for no message (returns the empty list)
- None for unlimited
@param between (bool): confound source and dest (ignore the direction)
@param profile (str): %(doc_profile)s
@return: list of tuple as in http://wiki.goffi.org/wiki/Bridge_API#getHistory
"""
assert(profile)
if limit == 0: