return proper error for attempting to update m.room.create

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-12-15 14:23:13 -05:00
parent 468071336b
commit 2ba0400758
No known key found for this signature in database

View file

@ -207,6 +207,11 @@ async fn allowed_to_send_state_event(
json: &Raw<AnyStateEventContent>,
) -> Result {
match event_type {
| StateEventType::RoomCreate => {
return Err!(Request(BadJson(
"You cannot update m.room.create after a room has been created."
)));
},
// Forbid m.room.encryption if encryption is disabled
| StateEventType::RoomEncryption =>
if !services.globals.allow_encryption() {