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

Properly handle presence events for application services. #8656

Merged
merged 1 commit into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all 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/8656.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug introduced in v1.22.0rc1 where presence events were not properly passed to application services.
9 changes: 5 additions & 4 deletions synapse/handlers/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def _handle_receipts(self, service: ApplicationService):

async def _handle_presence(
self, service: ApplicationService, users: Collection[UserID]
):
) -> List[JsonDict]:
events = [] # type: List[JsonDict]
presence_source = self.event_sources.sources["presence"]
from_key = await self.store.get_type_stream_id_for_appservice(
Expand All @@ -252,7 +252,7 @@ async def _handle_presence(
user=user, service=service, from_key=from_key,
)
time_now = self.clock.time_msec()
presence_events = [
events.extend(
{
"type": "m.presence",
"sender": event.user_id,
Expand All @@ -261,8 +261,9 @@ async def _handle_presence(
),
}
for event in presence_events
]
events = events + presence_events
)

return events

async def query_user_exists(self, user_id):
"""Check if any application service knows this user_id exists.
Expand Down