mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-09-08 01:41:51 +00:00
Get the equalities right.
This commit is contained in:
parent
3e6a19cf09
commit
ee06023573
@ -277,10 +277,13 @@ class MessageHandler(BaseRoomHandler):
|
|||||||
end_token=now_token.events_key,
|
end_token=now_token.events_key,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
start_token = now_token.copy_and_replace("events_key", token[0])
|
||||||
|
end_token = now_token.copy_and_replace("events_key", token[1])
|
||||||
|
|
||||||
d["messages"] = {
|
d["messages"] = {
|
||||||
"chunk": [m.get_dict() for m in messages],
|
"chunk": [m.get_dict() for m in messages],
|
||||||
"start": token[0],
|
"start": start_token.to_string(),
|
||||||
"end": token[1],
|
"end": end_token.to_string(),
|
||||||
}
|
}
|
||||||
|
|
||||||
current_state = yield self.store.get_current_state(
|
current_state = yield self.store.get_current_state(
|
||||||
|
@ -205,8 +205,11 @@ class StreamStore(SQLBaseStore):
|
|||||||
with_feedback=False):
|
with_feedback=False):
|
||||||
# TODO (erikj): Handle compressed feedback
|
# TODO (erikj): Handle compressed feedback
|
||||||
|
|
||||||
from_comp = '<' if direction =='b' else '>'
|
# Tokens really represent positions between elements, but we use
|
||||||
to_comp = '>' if direction =='b' else '<'
|
# 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"
|
order = "DESC" if direction == 'b' else "ASC"
|
||||||
|
|
||||||
args = [room_id]
|
args = [room_id]
|
||||||
|
Loading…
Reference in New Issue
Block a user