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:
parent
b631621f8c
commit
a8fa237fad
7 changed files with 135 additions and 219 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue