mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-18 18:19:16 -04:00
Bound ephemeral events by key (#12544)
Co-authored-by: Brad Murray <bradtgmurray@gmail.com> Co-authored-by: Andrew Morgan <andrewm@element.io>
This commit is contained in:
parent
9986621bc8
commit
63ba9ba38b
4 changed files with 87 additions and 4 deletions
|
@ -239,13 +239,14 @@ class ReceiptEventSource(EventSource[int, JsonDict]):
|
|||
return events, to_key
|
||||
|
||||
async def get_new_events_as(
|
||||
self, from_key: int, service: ApplicationService
|
||||
self, from_key: int, to_key: int, service: ApplicationService
|
||||
) -> Tuple[List[JsonDict], int]:
|
||||
"""Returns a set of new read receipt events that an appservice
|
||||
may be interested in.
|
||||
|
||||
Args:
|
||||
from_key: the stream position at which events should be fetched from
|
||||
to_key: the stream position up to which events should be fetched to
|
||||
service: The appservice which may be interested
|
||||
|
||||
Returns:
|
||||
|
@ -255,7 +256,6 @@ class ReceiptEventSource(EventSource[int, JsonDict]):
|
|||
* The current read receipt stream token.
|
||||
"""
|
||||
from_key = int(from_key)
|
||||
to_key = self.get_current_key()
|
||||
|
||||
if from_key == to_key:
|
||||
return [], to_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue