Skip to content

Commit

Permalink
Add a flag to /versions about SSS support (#17571)
Browse files Browse the repository at this point in the history
So that clients can check for support. Note that if the feature is only
enabled for some users, the `/versions` request must be authenticated to
pick up that SSS is enabled for the user
  • Loading branch information
erikjohnston authored Aug 16, 2024
1 parent fae75b0 commit 9ce489b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/17571.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a flag to `/versions`, `org.matrix.simplified_msc3575`, to indicate whether experimental sliding sync support has been enabled.
6 changes: 6 additions & 0 deletions synapse/rest/client/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(self, hs: "HomeServer"):

async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
msc3881_enabled = self.config.experimental.msc3881_enabled
msc3575_enabled = self.config.experimental.msc3575_enabled

if self.auth.has_access_token(request):
requester = await self.auth.get_user_by_req(
Expand All @@ -77,6 +78,9 @@ async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
msc3881_enabled = await self.store.is_feature_enabled(
user_id, ExperimentalFeature.MSC3881
)
msc3575_enabled = await self.store.is_feature_enabled(
user_id, ExperimentalFeature.MSC3575
)

return (
200,
Expand Down Expand Up @@ -169,6 +173,8 @@ async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
),
# MSC4151: Report room API (Client-Server API)
"org.matrix.msc4151": self.config.experimental.msc4151_enabled,
# Simplified sliding sync
"org.matrix.simplified_msc3575": msc3575_enabled,
},
},
)
Expand Down

0 comments on commit 9ce489b

Please sign in to comment.