mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-08-07 15:20:55 +00:00
Simplify api to send notices to admin room
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
84c3264c07
commit
e02fa39688
3 changed files with 32 additions and 49 deletions
|
@ -88,19 +88,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue