Warn the user before they ping the whole room

This commit is contained in:
Nicolas Werner 2021-09-02 03:15:07 +02:00
parent 0ce200fee5
commit 3528fe4e5d
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
8 changed files with 94 additions and 2 deletions

View file

@ -61,3 +61,10 @@ Permissions::canSend(int eventType)
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);
}