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

Fix issue causing sending presence to ASes to fail (due to incomplete type annotations) #10944

Merged
merged 3 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/10944.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in v1.44.0rc1 which prevented sending presence events to application services.
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,
*,
reivilibre marked this conversation as resolved.
Show resolved Hide resolved
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