The following accessors all fetch single values out of certain events, as they are commonly used.
name
$name = $state->name
Returns the "name" field of the "m.room.name" event, if it exists.
join_rule
$join_rule = $state->join_rule
Returns the "join_rule" field of the "m.room.join_rules" event, if it exists.
topic
$topic = $state->topic
Returns the "topic" field of the "m.room.topic" event, if it exists.
aliases
@aliases = $state->aliases
Returns a list of the room alias from all the "m.room.aliases" events, in no particular order.
members
@members = $state->members
Returns a list of Member instances representing all of the members of the room from the "m.room.member"
events whose membership state is not "leave".
all_members
@members = $state->members
Similar to "members" but even includes members in "leave" state. This is not normally what you want.
member
$member = $state->member( $user_id )
Returns a Member instance representing a room member of the given user ID, or "undef" if none exists.
member_level
$level = $state->member_level( $user_id )
Returns a number indicating the power level that the given user ID would have according to room state,
taken from the "m.room.power_levels" event. This takes into account the "users_default" field, if no
specific level exists for the given user ID.