Note that AS interest via room ID or alias isn't respected

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:

231084da13/proposals/2409-appservice-edus.md (expectations-of-when-an-edu-should-be-pushed-to-an-appservice)
This commit is contained in:
Andrew Morgan 2021-10-20 18:13:51 +01:00
parent 1df714c21c
commit 95a49727a6
2 changed files with 9 additions and 0 deletions

View file

@ -267,6 +267,10 @@ class ReceiptEventSource(EventSource[int, JsonDict]):
)
# 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):

View file

@ -481,6 +481,11 @@ class TypingNotificationEventSource(EventSource[int, JsonDict]):
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
):