Load past events when scrolling up

Also keep two nio clients internally: one for loop-syncing, one for the
rest; since they can't handle more than one talk at a time.
This commit is contained in:
miruka
2019-04-17 21:08:32 -04:00
parent 9e5e2c6718
commit a0f9acddaa
7 changed files with 129 additions and 49 deletions

View File

@@ -81,6 +81,21 @@ class SignalManager(QObject):
del rooms[rooms.indexWhere("room_id", room_id)]
def onRoomSyncPrevBatchTokenReceived(
self, _: Client, room_id: str, token: str
) -> None:
if room_id not in self.backend.past_tokens:
self.backend.past_tokens[room_id] = token
def onRoomPastPrevBatchTokenReceived(
self, _: Client, room_id: str, token: str
) -> None:
self.backend.past_tokens[room_id] = token
def onRoomEventReceived(
self, _: Client, room_id: str, etype: str, edict: Dict[str, Any]
) -> None: