diff --git a/changelog.d/10532.bugfix b/changelog.d/10532.bugfix new file mode 100644 index 000000000000..5cea4bbbcaa2 --- /dev/null +++ b/changelog.d/10532.bugfix @@ -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`. \ No newline at end of file diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py index 21a17cd2e834..7ab558912eab 100644 --- a/synapse/handlers/appservice.py +++ b/synapse/handlers/appservice.py @@ -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