diff --git a/roomserver/storage/postgres/storage.go b/roomserver/storage/postgres/storage.go index 4499388a0..6f8fd9f66 100644 --- a/roomserver/storage/postgres/storage.go +++ b/roomserver/storage/postgres/storage.go @@ -72,7 +72,9 @@ func (d *Database) StoreEvent( } } - roomVersion := strconv.Itoa(int(version.GetDefaultRoomVersion())) + // The only room version where the "room_version" key isn't specified is + // room version 1 + roomVersion := 1 // The below works because the first event to be persisted to the database // is always the m.room.create event. We can therefore set the room version // correctly at the same time as assigning the room NID. diff --git a/roomserver/storage/sqlite3/storage.go b/roomserver/storage/sqlite3/storage.go index b3f375887..e70a1b9ec 100644 --- a/roomserver/storage/sqlite3/storage.go +++ b/roomserver/storage/sqlite3/storage.go @@ -93,7 +93,9 @@ func (d *Database) StoreEvent( } } - roomVersion := strconv.Itoa(int(version.GetDefaultRoomVersion())) + // The only room version where the "room_version" key isn't specified is + // room version 1 + roomVersion := 1 // The below works because the first event to be persisted to the database // is always the m.room.create event. We can therefore set the room version // correctly at the same time as assigning the room NID.