File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -2437,18 +2437,30 @@ class Room {
24372437 JoinRules joinRules, {
24382438 /// For restricted rooms, the id of the room where a user needs to be member.
24392439 /// Learn more at https://spec.matrix.org/latest/client-server-api/#restricted-rooms
2440+ List <String >? allowConditionRoomIds,
2441+ @Deprecated ('Use allowConditionRoomIds instead!' )
24402442 String ? allowConditionRoomId,
24412443 }) async {
2444+ if (allowConditionRoomId != null ) {
2445+ allowConditionRoomIds ?? = [];
2446+ allowConditionRoomIds.add (allowConditionRoomId);
2447+ }
2448+
24422449 await client.setRoomStateWithKey (
24432450 id,
24442451 EventTypes .RoomJoinRules ,
24452452 '' ,
24462453 {
2447- 'join_rule' : joinRules.toString ().replaceAll ('JoinRules.' , '' ),
2448- if (allowConditionRoomId != null )
2449- 'allow' : [
2450- {'room_id' : allowConditionRoomId, 'type' : 'm.room_membership' },
2451- ],
2454+ 'join_rule' : joinRules.text,
2455+ if (allowConditionRoomIds != null )
2456+ 'allow' : allowConditionRoomIds
2457+ .map (
2458+ (allowConditionRoomId) => {
2459+ 'room_id' : allowConditionRoomId,
2460+ 'type' : 'm.room_membership' ,
2461+ },
2462+ )
2463+ .toList (),
24522464 },
24532465 );
24542466 return ;
You can’t perform that action at this time.
0 commit comments