|
14 | 14 | import logging |
15 | 15 | import random |
16 | 16 | from collections import namedtuple |
17 | | -from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple |
| 17 | +from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Set, Tuple |
18 | 18 |
|
19 | 19 | from synapse.api.errors import AuthError, ShadowBanError, SynapseError |
20 | 20 | from synapse.appservice import ApplicationService |
|
23 | 23 | wrap_as_background_process, |
24 | 24 | ) |
25 | 25 | from synapse.replication.tcp.streams import TypingStream |
| 26 | +from synapse.streams import EventSource |
26 | 27 | from synapse.types import JsonDict, Requester, UserID, get_domain_from_id |
27 | 28 | from synapse.util.caches.stream_change_cache import StreamChangeCache |
28 | 29 | from synapse.util.metrics import Measure |
@@ -439,7 +440,7 @@ def process_replication_rows( |
439 | 440 | raise Exception("Typing writer instance got typing info over replication") |
440 | 441 |
|
441 | 442 |
|
442 | | -class TypingNotificationEventSource: |
| 443 | +class TypingNotificationEventSource(EventSource[int, JsonDict]): |
443 | 444 | def __init__(self, hs: "HomeServer"): |
444 | 445 | self.hs = hs |
445 | 446 | self.clock = hs.get_clock() |
@@ -485,7 +486,13 @@ async def get_new_events_as( |
485 | 486 | return (events, handler._latest_room_serial) |
486 | 487 |
|
487 | 488 | async def get_new_events( |
488 | | - self, from_key: int, room_ids: Iterable[str], **kwargs: Any |
| 489 | + self, |
| 490 | + user: UserID, |
| 491 | + from_key: int, |
| 492 | + limit: Optional[int], |
| 493 | + room_ids: Iterable[str], |
| 494 | + is_guest: bool, |
| 495 | + explicit_room_id: Optional[str] = None, |
489 | 496 | ) -> Tuple[List[JsonDict], int]: |
490 | 497 | with Measure(self.clock, "typing.get_new_events"): |
491 | 498 | from_key = int(from_key) |
|
0 commit comments