mirror of
https://github.com/element-hq/synapse.git
synced 2026-06-03 23:31:27 +00:00
Make room versions a diff
This commit is contained in:
+15
-240
@@ -243,317 +243,92 @@ const ROOM_VERSION_V1: RoomVersion = RoomVersion {
|
||||
|
||||
const ROOM_VERSION_V2: RoomVersion = RoomVersion {
|
||||
identifier: "2",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V1_V2,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: false,
|
||||
special_case_aliases_auth: true,
|
||||
strict_canonicaljson: false,
|
||||
limit_notifications_power_levels: false,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: false,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: false,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V1
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V3: RoomVersion = RoomVersion {
|
||||
identifier: "3",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V3,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: false,
|
||||
special_case_aliases_auth: true,
|
||||
strict_canonicaljson: false,
|
||||
limit_notifications_power_levels: false,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: false,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: false,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V2
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V4: RoomVersion = RoomVersion {
|
||||
identifier: "4",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: false,
|
||||
special_case_aliases_auth: true,
|
||||
strict_canonicaljson: false,
|
||||
limit_notifications_power_levels: false,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: false,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: false,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V3
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V5: RoomVersion = RoomVersion {
|
||||
identifier: "5",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: true,
|
||||
strict_canonicaljson: false,
|
||||
limit_notifications_power_levels: false,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: false,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: false,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V4
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V6: RoomVersion = RoomVersion {
|
||||
identifier: "6",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: false,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: false,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V5
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V7: RoomVersion = RoomVersion {
|
||||
identifier: "7",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: false,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V6
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V8: RoomVersion = RoomVersion {
|
||||
identifier: "8",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: false,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V7
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V9: RoomVersion = RoomVersion {
|
||||
identifier: "9",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: true,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: false,
|
||||
enforce_int_power_levels: false,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V8
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V10: RoomVersion = RoomVersion {
|
||||
identifier: "10",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: true,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: true,
|
||||
enforce_int_power_levels: true,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V9
|
||||
};
|
||||
|
||||
/// MSC3389 (Redaction changes for events with a relation) based on room version "10".
|
||||
const ROOM_VERSION_MSC3389V10: RoomVersion = RoomVersion {
|
||||
identifier: "org.matrix.msc3389.10",
|
||||
disposition: RoomDisposition::UNSTABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: true,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: true, // Changed from v10
|
||||
knock_restricted_join_rule: true,
|
||||
enforce_int_power_levels: true,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
msc3389_relation_redactions: true,
|
||||
strict_event_byte_limits_room_versions: true,
|
||||
..ROOM_VERSION_V10
|
||||
};
|
||||
|
||||
/// MSC1767 (Extensible Events) based on room version "10".
|
||||
const ROOM_VERSION_MSC1767V10: RoomVersion = RoomVersion {
|
||||
identifier: "org.matrix.msc1767.10",
|
||||
disposition: RoomDisposition::UNSTABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: true,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: true,
|
||||
enforce_int_power_levels: true,
|
||||
msc3931_push_features: &[PushRuleRoomFlag::EXTENSIBLE_EVENTS],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V10
|
||||
};
|
||||
|
||||
/// MSC3757 (Restricting who can overwrite a state event) based on room version "10".
|
||||
const ROOM_VERSION_MSC3757V10: RoomVersion = RoomVersion {
|
||||
identifier: "org.matrix.msc3757.10",
|
||||
disposition: RoomDisposition::UNSTABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: false,
|
||||
updated_redaction_rules: false,
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: true,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: true,
|
||||
enforce_int_power_levels: true,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: true,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: false,
|
||||
..ROOM_VERSION_V10
|
||||
};
|
||||
|
||||
const ROOM_VERSION_V11: RoomVersion = RoomVersion {
|
||||
identifier: "11",
|
||||
disposition: RoomDisposition::STABLE,
|
||||
event_format: EventFormatVersions::ROOM_V4_PLUS,
|
||||
state_res: StateResolutionVersions::V2,
|
||||
enforce_key_validity: true,
|
||||
special_case_aliases_auth: false,
|
||||
strict_canonicaljson: true,
|
||||
limit_notifications_power_levels: true,
|
||||
implicit_room_creator: true, // Used by MSC3820
|
||||
updated_redaction_rules: true, // Used by MSC3820
|
||||
restricted_join_rule: true,
|
||||
restricted_join_rule_fix: true,
|
||||
knock_join_rule: true,
|
||||
msc3389_relation_redactions: false,
|
||||
knock_restricted_join_rule: true,
|
||||
enforce_int_power_levels: true,
|
||||
msc3931_push_features: &[],
|
||||
msc3757_enabled: false,
|
||||
msc4289_creator_power_enabled: false,
|
||||
msc4291_room_ids_as_hashes: false,
|
||||
strict_event_byte_limits_room_versions: true, // Changed from v10
|
||||
strict_event_byte_limits_room_versions: true,
|
||||
..ROOM_VERSION_V10
|
||||
};
|
||||
|
||||
/// MSC3757 (Restricting who can overwrite a state event) based on room version "11".
|
||||
|
||||
Reference in New Issue
Block a user