memory: fixed getHistory behavior when parameter between=True:

- the previous behavior returns the messages between X and Y + between X and X
This commit is contained in:
souliane 2013-10-23 00:28:00 +02:00
commit 63ba8ab235

View file

@ -229,10 +229,10 @@ class SqliteStorage(object):
return '%s=?' % (type_, )
if between:
query_parts.append("(%s OR %s) AND (%s or %s)" % (test_jid('source', from_jid),
test_jid('source', to_jid),
test_jid('dest', to_jid),
test_jid('dest', from_jid)))
query_parts.append("((%s AND %s) OR (%s AND %s))" % (test_jid('source', from_jid),
test_jid('dest', to_jid),
test_jid('source', to_jid),
test_jid('dest', from_jid)))
else:
query_parts.append("%s AND %s" % (test_jid('source', from_jid),
test_jid('dest', to_jid)))