mtx::events::state::PowerLevels struct

Content for the m.room.power_levels state event.

This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room.

Public functions

auto event_level(const std::string& event_type) const -> power_level_t
Returns the power_level for a given event type.
auto state_level(const std::string& event_type) const -> power_level_t
Returns the power_level for a given event type.
auto user_level(const std::string& user_id) const -> power_level_t
Returns the power_level for a given user id.

Public variables

power_level_t ban
The level required to ban a user. Defaults to 50 if unspecified.
power_level_t invite
The level required to invite a user. Defaults to 50 if unspecified.
power_level_t kick
The level required to kick a user. Defaults to 50 if unspecified.
power_level_t redact
The level required to redact an event. Defaults to 50 if unspecified.
power_level_t events_default
The default level required to send message events. Defaults to 0 if unspecified.
power_level_t users_default
The default power level for every user in the room, unless their user_id is mentioned in the users key. Defaults to 0 if unspecified.
power_level_t state_default
The default level required to send state events.
std::map<std::string, power_level_t, std::less<>> events
The level required to send specific event types. This is a mapping from event type to power level required.
std::map<std::string, power_level_t, std::less<>> users
The power levels for specific users. This is a mapping from user_id to power level for that user.
std::map<std::string, power_level_t, std::less<>> notifications
The power level requirements for specific notification types. This is a mapping from key to power level for that notifications key.