joinRules property

JoinRules? joinRules

A room may be public meaning anyone can join the room without any prior action. Alternatively, it can be invite meaning that a user who wishes to join the room must first receive an invite to the room from someone already inside of the room. Currently, knock and private are reserved keywords which are not implemented.

Implementation

JoinRules? get joinRules {
  final joinRule = getState(EventTypes.RoomJoinRules)?.content['join_rule'];
  return joinRule != null
      ? JoinRules.values.firstWhereOrNull(
          (r) => r.toString().replaceAll('JoinRules.', '') == joinRule)
      : null;
}