diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-02-09 16:30:49 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-02-09 16:30:49 +0100 |
commit | f11fe491349854526f8d13e8b62458baeb3b23b6 (patch) | |
tree | c1c423d6bce67b2aa235b28daac914e6a7d1a6d9 /LibMatrix.EventTypes/Spec/State/RoomInfo/RoomPowerLevelEventContent.cs | |
parent | Allow specifying chunk size for GetManyMessages (diff) | |
download | LibMatrix-f11fe491349854526f8d13e8b62458baeb3b23b6.tar.xz |
Consistently use EventId for event types
Diffstat (limited to '')
-rw-r--r-- | LibMatrix.EventTypes/Spec/State/RoomInfo/RoomPowerLevelEventContent.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomPowerLevelEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomPowerLevelEventContent.cs index 325a10e..cb9ebb7 100644 --- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomPowerLevelEventContent.cs +++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomPowerLevelEventContent.cs @@ -67,13 +67,11 @@ public class RoomPowerLevelEventContent : EventContent { return Users.TryGetValue(userId, out var level) ? level : UsersDefault ?? UsersDefault ?? 0; } - public long GetEventPowerLevel(string eventType) { - return Events.TryGetValue(eventType, out var level) ? level : EventsDefault ?? EventsDefault ?? 0; - } + public long GetEventPowerLevel(string eventType) => Events.TryGetValue(eventType, out var level) ? level : EventsDefault ?? EventsDefault ?? 0; public void SetUserPowerLevel(string userId, long powerLevel) { ArgumentNullException.ThrowIfNull(userId); - Users ??= new(); + Users ??= new Dictionary<string, long>(); Users[userId] = powerLevel; } -} +} \ No newline at end of file |