1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-08-11 17:50:59 +00:00

refactor: use RoomVersionRules instead of matching against RoomVersionId

This commit is contained in:
Matthias Ahouansou 2025-07-02 19:39:03 +01:00
parent b631621f8c
commit a8fa237fad
No known key found for this signature in database
7 changed files with 135 additions and 219 deletions

View file

@ -2021,16 +2021,11 @@ fn user_can_perform_restricted_join(
return Ok(false);
};
if matches!(
room_version_id,
RoomVersionId::V1
| RoomVersionId::V2
| RoomVersionId::V3
| RoomVersionId::V4
| RoomVersionId::V5
| RoomVersionId::V6
| RoomVersionId::V7
) {
let rules = room_version_id
.rules()
.expect("Supported room version must have rules.")
.authorization;
if !rules.restricted_join_rule {
return Ok(false);
}