Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19874.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add experimental support for [MSC4491: Invite reasons in room creation](https://github.com/matrix-org/matrix-spec-proposals/pull/4491).
3 changes: 3 additions & 0 deletions synapse/config/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,3 +617,6 @@ def read_config(
# MSC4455: Preview URL capability
# Tracked in: https://github.com/element-hq/synapse/issues/19719
self.msc4452_enabled: bool = experimental.get("msc4452_enabled", False)

# MSC4491: Invite reasons in room creation
self.msc4491_enabled: bool = experimental.get("msc4491_enabled", False)
5 changes: 5 additions & 0 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,11 @@ async def create_room(
if is_direct:
content["is_direct"] = is_direct

if self.config.experimental.msc4491_enabled:
reason = config.get("uk.timedout.msc4491.invite_reason")
if reason and isinstance(reason, str):
content["reason"] = reason

for invitee in invite_list:
(
member_event_id,
Expand Down
1 change: 1 addition & 0 deletions synapse/rest/client/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ async def on_GET(self, request: SynapseRequest) -> tuple[int, JsonDict]:
"org.matrix.msc4380.stable": True,
# MSC4445: Sync timeline order
"org.matrix.msc4445.initial_sync_timeline_topological_ordering": True,
"uk.timedout.msc4491.create_room_invite_reasons": self.config.experimental.msc4491_enabled,
},
},
)
Expand Down
Loading