Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix up type annotations for get_new_events on EventSource subclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Sep 29, 2021
1 parent a7f67ac commit fa53832
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions synapse/handlers/account_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def get_current_key(self, direction: str = "f") -> int:
async def get_new_events(
self,
user: UserID,
*,
from_key: int,
limit: Optional[int],
room_ids: Collection[str],
Expand Down
5 changes: 4 additions & 1 deletion synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from synapse.api.constants import EventTypes, Membership, PresenceState
from synapse.api.errors import SynapseError
from synapse.api.presence import UserPresenceState
from synapse.appservice import ApplicationService
from synapse.events.presence_router import PresenceRouter
from synapse.logging.context import run_in_background
from synapse.logging.utils import log_function
Expand Down Expand Up @@ -1519,12 +1520,14 @@ def __init__(self, hs: "HomeServer"):
async def get_new_events(
self,
user: UserID,
*,
from_key: Optional[int],
limit: Optional[int] = None,
room_ids: Optional[List[str]] = None,
room_ids: Optional[Collection[str]] = None,
is_guest: bool = False,
explicit_room_id: Optional[str] = None,
include_offline: bool = True,
service: Optional[ApplicationService] = None,
) -> Tuple[List[UserPresenceState], int]:
# The process for getting presence events are:
# 1. Get the rooms the user is in.
Expand Down
1 change: 1 addition & 0 deletions synapse/handlers/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def filter_out_hidden(events: List[JsonDict], user_id: str) -> List[JsonDict]:
async def get_new_events(
self,
user: UserID,
*,
from_key: int,
limit: Optional[int],
room_ids: Iterable[str],
Expand Down
1 change: 1 addition & 0 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,7 @@ def __init__(self, hs: "HomeServer"):
async def get_new_events(
self,
user: UserID,
*,
from_key: RoomStreamToken,
limit: Optional[int],
room_ids: Collection[str],
Expand Down
1 change: 1 addition & 0 deletions synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ async def get_new_events_as(
async def get_new_events(
self,
user: UserID,
*,
from_key: int,
limit: Optional[int],
room_ids: Iterable[str],
Expand Down
1 change: 1 addition & 0 deletions synapse/streams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class EventSource(Generic[K, R]):
async def get_new_events(
self,
user: UserID,
*,
from_key: K,
limit: Optional[int],
room_ids: Collection[str],
Expand Down

0 comments on commit fa53832

Please sign in to comment.