diff options
Diffstat (limited to 'lib/events/roompowerlevelsevent.cpp')
-rw-r--r-- | lib/events/roompowerlevelsevent.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/events/roompowerlevelsevent.cpp b/lib/events/roompowerlevelsevent.cpp index aff64cff..98588142 100644 --- a/lib/events/roompowerlevelsevent.cpp +++ b/lib/events/roompowerlevelsevent.cpp @@ -41,6 +41,16 @@ int RoomPowerLevelsEvent::powerLevelForEvent(const QString &eventId) const { return eventsDefault(); } +int RoomPowerLevelsEvent::powerLevelForState(const QString &eventId) const { + auto e = events(); + + if (e.contains(eventId)) { + return e[eventId]; + } + + return stateDefault(); +} + int RoomPowerLevelsEvent::powerLevelForUser(const QString &userId) const { auto u = users(); |