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

Commit

Permalink
Note that AS interest via room ID or alias isn't respected
Browse files Browse the repository at this point in the history
Typing and read receipt events (those that are associated with a room)
should be sent to an AS that has registered interest in that room,
according to MSC2409:

https://github.com/Sorunome/matrix-doc/blob/231084da132af6518ecefa2a42c37937dfe373d2/proposals/2409-appservice-edus.md#expectations-of-when-an-edu-should-be-pushed-to-an-appservice
  • Loading branch information
anoadragon453 committed Oct 20, 2021
1 parent 1df714c commit 95a4972
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/handlers/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ async def get_new_events_as(
)

# Then filter down to rooms that the AS can read
# TODO: This doesn't seem to honour an appservice's registration of room or
# namespace aliases. For instance, if an appservice registered a room namespace
# that matched this room, but it didn't have any members in the room, then that
# appservice wouldn't receive the read receipt.
events = []
for room_id, event in rooms_to_events.items():
if not await service.matches_user_in_member_list(room_id, self.store):
Expand Down
5 changes: 5 additions & 0 deletions synapse/handlers/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ async def get_new_events_as(
for room_id in handler._room_serials.keys():
if handler._room_serials[room_id] <= from_key:
continue

# TODO: This doesn't seem to honour an appservice's registration of room or
# namespace aliases. For instance, if an appservice registered a room namespace
# that matched this room, but it didn't have any members in the room, then that
# appservice wouldn't receive the typing event.
if not await service.matches_user_in_member_list(
room_id, handler.store
):
Expand Down

0 comments on commit 95a4972

Please sign in to comment.