Get the equalities right.

This commit is contained in:
Erik Johnston 2014-08-29 13:28:02 +01:00
parent 3e6a19cf09
commit ee06023573
2 changed files with 10 additions and 4 deletions

View file

@ -205,8 +205,11 @@ class StreamStore(SQLBaseStore):
with_feedback=False):
# TODO (erikj): Handle compressed feedback
from_comp = '<' if direction =='b' else '>'
to_comp = '>' if direction =='b' else '<'
# Tokens really represent positions between elements, but we use
# the convention of pointing to the event before the gap. Hence
# we have a bit of asymmetry when it comes to equalities.
from_comp = '<=' if direction =='b' else '>'
to_comp = '>' if direction =='b' else '<='
order = "DESC" if direction == 'b' else "ASC"
args = [room_id]