branch: externals/ement commit c9ed0b16ef8fd31e26a2fd2f6594fae6bd7ce64b Author: Adam Porter <a...@alphapapa.net> Commit: Adam Porter <a...@alphapapa.net>
Fix: (ement-room-retro-callback) Don't clear end token if none If the response doesn't include an end token, don't clear the room's end token (which would make future "retro" requests load events from the end of the room's timeline, as if we hadn't received any). See #148. --- ement-room.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ement-room.el b/ement-room.el index 563ad70dc0..a10d30a935 100644 --- a/ement-room.el +++ b/ement-room.el @@ -2520,7 +2520,10 @@ before the earliest-seen message)." (select-window buffer-window)) ;; FIXME: Use retro-loading in event handlers, or in --handle-events, anyway. (ement-room--process-events chunk) - (when set-prev-batch + ;; Don't set the slot if the response doesn't include an "end" token (that + ;; would cause subsequent retro requests to fetch events from the end of the + ;; timeline, as if we had just joined). + (when (and set-prev-batch end) ;; This feels a little hacky, but maybe not too bad. (setf (ement-room-prev-batch room) end)) (setf ement-room-retro-loading nil)))))