Improve room past events loading

- Trigger when room is shown if there's not enough messages to fill the
  list height

- Trigger whenever user is scrolling before a certain point, instead of
  when dragging is released/scrolling stopped and the top edge is hit

- Prevent multiple load requests at same time

- Keep a set of fully loaded rooms, don't request anymore history
  if a room is fully loaded
This commit is contained in:
miruka
2019-04-17 22:34:22 -04:00
parent a0f9acddaa
commit 6ab4acdc84
5 changed files with 39 additions and 9 deletions

View File

@@ -93,6 +93,9 @@ class SignalManager(QObject):
self, _: Client, room_id: str, token: str
) -> None:
if self.backend.past_tokens[room_id] == token:
self.backend.fully_loaded_rooms.add(room_id)
self.backend.past_tokens[room_id] = token