setJoinRules method

Future<void> setJoinRules(
  1. JoinRules joinRules
)

Changes the join rules. You should check first if the user is able to change it.

Implementation

Future<void> setJoinRules(JoinRules joinRules) async {
  await client.setRoomStateWithKey(
    id,
    EventTypes.RoomJoinRules,
    '',
    {
      'join_rule': joinRules.toString().replaceAll('JoinRules.', ''),
    },
  );
  return;
}