diff options
Diffstat (limited to 'lib/events')
-rw-r--r-- | lib/events/roompowerlevelsevent.cpp | 4 | ||||
-rw-r--r-- | lib/events/roompowerlevelsevent.h | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/events/roompowerlevelsevent.cpp b/lib/events/roompowerlevelsevent.cpp index a6efaa63..aff64cff 100644 --- a/lib/events/roompowerlevelsevent.cpp +++ b/lib/events/roompowerlevelsevent.cpp @@ -31,7 +31,7 @@ void PowerLevelsEventContent::fillJson(QJsonObject* o) const { o->insert(QStringLiteral("notifications"), {{"room", notifications.room}}); } -int RoomPowerLevelsEvent::powerLevelForEvent(const QString &eventId) { +int RoomPowerLevelsEvent::powerLevelForEvent(const QString &eventId) const { auto e = events(); if (e.contains(eventId)) { @@ -41,7 +41,7 @@ int RoomPowerLevelsEvent::powerLevelForEvent(const QString &eventId) { return eventsDefault(); } -int RoomPowerLevelsEvent::powerLevelForUser(const QString &userId) { +int RoomPowerLevelsEvent::powerLevelForUser(const QString &userId) const { auto u = users(); if (u.contains(userId)) { diff --git a/lib/events/roompowerlevelsevent.h b/lib/events/roompowerlevelsevent.h index 3a940380..b3405c56 100644 --- a/lib/events/roompowerlevelsevent.h +++ b/lib/events/roompowerlevelsevent.h @@ -40,23 +40,23 @@ public: : StateEvent(typeId(), obj) {} - int invite() { return content().invite; } - int kick() { return content().kick; } - int ban() { return content().ban; } + int invite() const { return content().invite; } + int kick() const { return content().kick; } + int ban() const { return content().ban; } - int redact() { return content().redact; } + int redact() const { return content().redact; } - QHash<QString, int> events() { return content().events; } - int eventsDefault() { return content().eventsDefault; } - int stateDefault() { return content().stateDefault; } + QHash<QString, int> events() const { return content().events; } + int eventsDefault() const { return content().eventsDefault; } + int stateDefault() const { return content().stateDefault; } - QHash<QString, int> users() { return content().users; } - int usersDefault() { return content().usersDefault; } + QHash<QString, int> users() const { return content().users; } + int usersDefault() const { return content().usersDefault; } - int roomNotification() { return content().notifications.room; } + int roomNotification() const { return content().notifications.room; } - int powerLevelForEvent(const QString& eventId); - int powerLevelForUser(const QString& userId); + int powerLevelForEvent(const QString& eventId) const; + int powerLevelForUser(const QString& userId) const; private: }; |