summary refs log tree commit diff
path: root/src/timeline/Permissions.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-09-18 00:22:33 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-09-18 00:45:50 +0200
commitcfca7157b98c9dc8e0852fe6484bc3f75008af7d (patch)
tree32b92340908a9374214ec7b84c1fac7ea338f56d /src/timeline/Permissions.cpp
parentMerge pull request #728 from Thulinma/goto (diff)
downloadnheko-cfca7157b98c9dc8e0852fe6484bc3f75008af7d.tar.xz
Change indentation to 4 spaces
Diffstat (limited to 'src/timeline/Permissions.cpp')
-rw-r--r--src/timeline/Permissions.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/timeline/Permissions.cpp b/src/timeline/Permissions.cpp

index 5dafc325..4e45f2e2 100644 --- a/src/timeline/Permissions.cpp +++ b/src/timeline/Permissions.cpp
@@ -12,59 +12,59 @@ Permissions::Permissions(QString roomId, QObject *parent) : QObject(parent) , roomId_(roomId) { - invalidate(); + invalidate(); } void Permissions::invalidate() { - pl = cache::client() - ->getStateEvent<mtx::events::state::PowerLevels>(roomId_.toStdString()) - .value_or(mtx::events::StateEvent<mtx::events::state::PowerLevels>{}) - .content; + pl = cache::client() + ->getStateEvent<mtx::events::state::PowerLevels>(roomId_.toStdString()) + .value_or(mtx::events::StateEvent<mtx::events::state::PowerLevels>{}) + .content; } bool Permissions::canInvite() { - return pl.user_level(http::client()->user_id().to_string()) >= pl.invite; + return pl.user_level(http::client()->user_id().to_string()) >= pl.invite; } bool Permissions::canBan() { - return pl.user_level(http::client()->user_id().to_string()) >= pl.ban; + return pl.user_level(http::client()->user_id().to_string()) >= pl.ban; } bool Permissions::canKick() { - return pl.user_level(http::client()->user_id().to_string()) >= pl.kick; + return pl.user_level(http::client()->user_id().to_string()) >= pl.kick; } bool Permissions::canRedact() { - return pl.user_level(http::client()->user_id().to_string()) >= pl.redact; + return pl.user_level(http::client()->user_id().to_string()) >= pl.redact; } bool Permissions::canChange(int eventType) { - return pl.user_level(http::client()->user_id().to_string()) >= - pl.state_level(to_string(qml_mtx_events::fromRoomEventType( - static_cast<qml_mtx_events::EventType>(eventType)))); + return pl.user_level(http::client()->user_id().to_string()) >= + pl.state_level(to_string( + qml_mtx_events::fromRoomEventType(static_cast<qml_mtx_events::EventType>(eventType)))); } bool Permissions::canSend(int eventType) { - return pl.user_level(http::client()->user_id().to_string()) >= - pl.event_level(to_string(qml_mtx_events::fromRoomEventType( - static_cast<qml_mtx_events::EventType>(eventType)))); + return pl.user_level(http::client()->user_id().to_string()) >= + pl.event_level(to_string( + qml_mtx_events::fromRoomEventType(static_cast<qml_mtx_events::EventType>(eventType)))); } bool Permissions::canPingRoom() { - return pl.user_level(http::client()->user_id().to_string()) >= - pl.notification_level(mtx::events::state::notification_keys::room); + return pl.user_level(http::client()->user_id().to_string()) >= + pl.notification_level(mtx::events::state::notification_keys::room); }