Simplify api to send notices to admin room

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk authored and Jade Ellis committed 2025-07-02 18:58:18 +01:00
1 parent 732a77f3a8
commit 21bbee8e3c
3 files changed
+32 -49

No files matched your search

+6 -8
View File
@@ -92,19 +92,17 @@ pub(crate) async fn create_room_route(
&& !services.users.is_admin(sender_user).await
&& body.appservice_info.is_none()
{
info!(
"Non-admin user {sender_user} tried to publish {0} to the room directory while \
\"lockdown_public_room_directory\" is enabled",
&room_id
warn!(
"Non-admin user {sender_user} tried to publish {room_id} to the room directory \
while \"lockdown_public_room_directory\" is enabled"
);
if services.server.config.admin_room_notices {
services
.admin
.send_text(&format!(
"Non-admin user {sender_user} tried to publish {0} to the room directory \
while \"lockdown_public_room_directory\" is enabled",
&room_id
.notice(&format!(
"Non-admin user {sender_user} tried to publish {room_id} to the room \
directory while \"lockdown_public_room_directory\" is enabled"
))
.await;
}