mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 03:54:58 -04:00
Remove concept of a non-limited stream. (#7011)
This commit is contained in:
parent
caec7d4fa0
commit
fdb1344716
8 changed files with 72 additions and 68 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
import logging
|
||||
from collections import namedtuple
|
||||
from typing import List
|
||||
|
||||
from twisted.internet import defer
|
||||
|
||||
|
@ -257,7 +258,13 @@ class TypingHandler(object):
|
|||
"typing_key", self._latest_room_serial, rooms=[member.room_id]
|
||||
)
|
||||
|
||||
async def get_all_typing_updates(self, last_id, current_id):
|
||||
async def get_all_typing_updates(
|
||||
self, last_id: int, current_id: int, limit: int
|
||||
) -> List[dict]:
|
||||
"""Get up to `limit` typing updates between the given tokens, earliest
|
||||
updates first.
|
||||
"""
|
||||
|
||||
if last_id == current_id:
|
||||
return []
|
||||
|
||||
|
@ -275,7 +282,7 @@ class TypingHandler(object):
|
|||
typing = self._room_typing[room_id]
|
||||
rows.append((serial, room_id, list(typing)))
|
||||
rows.sort()
|
||||
return rows
|
||||
return rows[:limit]
|
||||
|
||||
def get_current_token(self):
|
||||
return self._latest_room_serial
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue