MatrixEventRoomPowerLevels

MatrixEventRoomPowerLevels — Class to handle m.room.power_levels event

Functions

Types and Values

Description

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. If a user_id is in the users list, then that user_id has the associated power level. Otherwise they have the default level users_default. If users_default is not supplied, it is assumed to be 0. The level required to send a certain event is governed by events, state_default and events_default. If an event type is specified in events, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to events_default for Message Events and state_default for State Events.

Functions

MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS

#define MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS (matrix_event_room_power_levels_get_type ())

The type for MatrixEventRoomPowerLevels.


matrix_event_room_power_levels_new ()

MatrixEventRoomPowerLevels *
matrix_event_room_power_levels_new (void);

matrix_event_room_power_levels_get_users_default ()

gint
matrix_event_room_power_levels_get_users_default
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "users-default" property.

The default power level for every user in the room, unless their user_id is mentioned in the users key.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "users-default" property


matrix_event_room_power_levels_set_users_default ()

void
matrix_event_room_power_levels_set_users_default
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "users-default" property to value .

The default power level for every user in the room, unless their user_id is mentioned in the users key.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "users-default" property

 

matrix_event_room_power_levels_get_events_default ()

gint
matrix_event_room_power_levels_get_events_default
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "events-default" property.

The default level required to send message events. Can be overridden by the events key.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "events-default" property


matrix_event_room_power_levels_set_events_default ()

void
matrix_event_room_power_levels_set_events_default
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "events-default" property to value .

The default level required to send message events. Can be overridden by the events key.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "events-default" property

 

matrix_event_room_power_levels_get_state_default ()

gint
matrix_event_room_power_levels_get_state_default
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "state-default" property.

The default level required to send state events. Can be overridden by the events key.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "state-default" property


matrix_event_room_power_levels_set_state_default ()

void
matrix_event_room_power_levels_set_state_default
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "state-default" property to value .

The default level required to send state events. Can be overridden by the events key.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "state-default" property

 

matrix_event_room_power_levels_get_ban ()

gint
matrix_event_room_power_levels_get_ban
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "ban" property.

The level required to ban a user.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "ban" property


matrix_event_room_power_levels_set_ban ()

void
matrix_event_room_power_levels_set_ban
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "ban" property to value .

The level required to ban a user.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "ban" property

 

matrix_event_room_power_levels_get_kick ()

gint
matrix_event_room_power_levels_get_kick
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "kick" property.

The level required to kick a user.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "kick" property


matrix_event_room_power_levels_set_kick ()

void
matrix_event_room_power_levels_set_kick
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "kick" property to value .

The level required to kick a user.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "kick" property

 

matrix_event_room_power_levels_get_redact ()

gint
matrix_event_room_power_levels_get_redact
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "redact" property.

The level required to redact an event.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "redact" property


matrix_event_room_power_levels_set_redact ()

void
matrix_event_room_power_levels_set_redact
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "redact" property to value .

The level required to redact an event.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "redact" property

 

matrix_event_room_power_levels_get_invite ()

gint
matrix_event_room_power_levels_get_invite
                               (MatrixEventRoomPowerLevels *self);

Get and return the current value of the "invite" property.

The level required to invite someone.

Parameters

self

the MatrixEventRoomPowerLevels instance to query

 

Returns

the value of the "invite" property


matrix_event_room_power_levels_set_invite ()

void
matrix_event_room_power_levels_set_invite
                               (MatrixEventRoomPowerLevels *self,
                                gint value);

Set the value of the "invite" property to value .

The level required to invite someone.

Parameters

self

the MatrixEventRoomPowerLevels instance to modify

 

value

the new value of the "invite" property

 

Types and Values

struct MatrixEventRoomPowerLevels

struct MatrixEventRoomPowerLevels {
	MatrixEventState parent_instance;
	MatrixEventRoomPowerLevelsPrivate * priv;
};

Class to handle m.room.power_levels 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. If a user_id is in the users list, then that user_id has the associated power level. Otherwise they have the default level users_default. If users_default is not supplied, it is assumed to be 0. The level required to send a certain event is governed by events, state_default and events_default. If an event type is specified in events, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to events_default for Message Events and state_default for State Events.


struct MatrixEventRoomPowerLevelsClass

struct MatrixEventRoomPowerLevelsClass {
	MatrixEventStateClass parent_class;
};

The class structure for MATRIX_EVENT_TYPE_ROOM_POWER_LEVELS. All the fields in this structure are private and should never be accessed directly.

Members

MatrixEventStateClass parent_class;

the parent class structure