aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/perform/perform_create_room.go
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-09-27 08:27:08 +0200
committerGitHub <noreply@github.com>2023-09-27 08:27:08 +0200
commit05a8f1ede3ca0ccd0f9a7d327ef3cb30b6fd2798 (patch)
treecda98010f6bf78dd4a595d5132dcf5186c20a99f /roomserver/internal/perform/perform_create_room.go
parent16d922de701ca28966127b2e1160d65527f65e8e (diff)
Support for room version v11 (#3204)
Fixes #3203
Diffstat (limited to 'roomserver/internal/perform/perform_create_room.go')
-rw-r--r--roomserver/internal/perform/perform_create_room.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/roomserver/internal/perform/perform_create_room.go b/roomserver/internal/perform/perform_create_room.go
index cd6629d2..eb8de781 100644
--- a/roomserver/internal/perform/perform_create_room.go
+++ b/roomserver/internal/perform/perform_create_room.go
@@ -90,7 +90,16 @@ func (c *Creator) PerformCreateRoom(ctx context.Context, userID spec.UserID, roo
} else {
senderID = spec.SenderID(userID.String())
}
- createContent["creator"] = senderID
+
+ // TODO: Maybe, at some point, GMSL should return the events to create, so we can define the version
+ // entirely there.
+ switch createRequest.RoomVersion {
+ case gomatrixserverlib.RoomVersionV11:
+ // RoomVersionV11 removed the creator field from the create content: https://github.com/matrix-org/matrix-spec-proposals/pull/2175
+ default:
+ createContent["creator"] = senderID
+ }
+
createContent["room_version"] = createRequest.RoomVersion
powerLevelContent := eventutil.InitialPowerLevelsContent(string(senderID))
joinRuleContent := gomatrixserverlib.JoinRuleContent{