diff --git a/src/utils/roomVersion.ts b/src/utils/roomVersion.ts index e90b0ab92b..0b03cf4532 100644 --- a/src/utils/roomVersion.ts +++ b/src/utils/roomVersion.ts @@ -17,24 +17,19 @@ limitations under the License. /** * Room versions strings that we know about and do not use hydra semantics. */ -const HYDRA_ROOM_VERSIONS = ["org.matrix.hydra.11", "12"]; +const PRE_HYDRA_ROOM_VERSIONS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"]; /** * Checks if the given room version is one where new "hydra" power level * semantics (ie. room version 12 or later) should be used * (see https://github.com/matrix-org/matrix-spec-proposals/pull/4289). - * This will return `true` for versions that are known to the js-sdk and - * use hydra: any room versions unknown to the js-sdk (experimental or - * otherwise) will cause the function to return `false`. + * This will return `false` for versions that are known to the js-sdk and + * do not use hydra: any room versions unknown to the js-sdk (experimental or + * otherwise) will cause the function to return true. * * @param roomVersion - The version of the room to check. * @returns `true` if hydra semantics should be used for the room version, `false` otherwise. */ export function shouldUseHydraForRoomVersion(roomVersion: string): boolean { - // Future new room versions must obviously be added to the constant above, - // otherwise the js-sdk will use the old, pre-hydra semantics. At some point - // it would make sense to assume hydra for unknown versions but this will break - // any rooms using unknown versions, so at hydra switch time we've agreed all - // Element clients will only use hydra for the two specific hydra versions. - return HYDRA_ROOM_VERSIONS.includes(roomVersion); + return !PRE_HYDRA_ROOM_VERSIONS.includes(roomVersion); }