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

Commit

Permalink
Check that a appservice protocol has at least one service
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Aug 4, 2021
1 parent 42225aa commit 1cc4a3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/10532.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Only report protocols that are implemented by at least one service, as required by the spec when handling `GET /_matrix/client/r0/thirdparty/protocols`.
6 changes: 5 additions & 1 deletion synapse/handlers/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ def _merge_instances(infos: List[JsonDict]) -> JsonDict:

return combined

return {p: _merge_instances(protocols[p]) for p in protocols.keys()}
return {
p: _merge_instances(protocols[p])
for p in protocols.keys()
if len(protocols[p]) > 0
}

async def _get_services_for_event(
self, event: EventBase
Expand Down

0 comments on commit 1cc4a3d

Please sign in to comment.