Class PowerLevelsContent
Content of m.room.power_levels: who may do what in a room, as levels from 0 up, where 100 is usually an admin and 50 a moderator.
Inheritance
PowerLevelsContent
Namespace: Uniform.Matrix.Protocol.Core
Assembly: Uniform.Matrix.Protocol.Core.dll
Syntax
public sealed record PowerLevelsContent : IEquatable<PowerLevelsContent>
Fields
|
Edit this page
View Source
Admin
Declaration
public const long Admin = 100
Field Value
|
Edit this page
View Source
Creator
Level of a room's creators from room version 12, above any level that can be given.
Declaration
public const long Creator = 9223372036854775807
Field Value
|
Edit this page
View Source
Moderator
Usual level of a moderator.
Declaration
public const long Moderator = 50
Field Value
Properties
|
Edit this page
View Source
Ban
Level needed to ban; 50 when unset.
Declaration
public long? Ban { get; init; }
Property Value
|
Edit this page
View Source
Events
Levels needed to send events by type.
Declaration
public Dictionary<string, long>? Events { get; init; }
Property Value
|
Edit this page
View Source
EventsDefault
Level needed to send message events not in Events; 0 when unset.
Declaration
public long? EventsDefault { get; init; }
Property Value
|
Edit this page
View Source
Other fields, kept as they are.
Declaration
[JsonExtensionData]
public Dictionary<string, JsonElement>? Extra { get; init; }
Property Value
|
Edit this page
View Source
Invite
Level needed to invite; 0 when unset.
Declaration
public long? Invite { get; init; }
Property Value
|
Edit this page
View Source
Kick
Level needed to kick; 50 when unset.
Declaration
public long? Kick { get; init; }
Property Value
|
Edit this page
View Source
Redact
Level needed to delete others' events; 50 when unset.
Declaration
public long? Redact { get; init; }
Property Value
|
Edit this page
View Source
StateDefault
Level needed to send state events not in Events; 50 when unset.
Declaration
public long? StateDefault { get; init; }
Property Value
|
Edit this page
View Source
Users
Levels of users by user ID.
Declaration
public Dictionary<string, long>? Users { get; init; }
Property Value
|
Edit this page
View Source
UsersDefault
Level of users not in Users; 0 when unset.
Declaration
public long? UsersDefault { get; init; }
Property Value
Methods
|
Edit this page
View Source
GetEventLevel(string, bool)
Return the level needed to send an event of eventType; isState chooses the default.
Declaration
public long GetEventLevel(string eventType, bool isState)
Parameters
| Type |
Name |
Description |
| string |
eventType |
|
| bool |
isState |
|
Returns
|
Edit this page
View Source
GetUserLevel(string)
Return the level of userId.
Declaration
public long GetUserLevel(string userId)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
Returns
|
Edit this page
View Source
WithUserLevel(string, long)
Return a copy where userId has level; the default level removes the explicit entry.
Declaration
public PowerLevelsContent WithUserLevel(string userId, long level)
Parameters
Returns
Implements