feat: Record metadata about user suspensions

This commit is contained in:
Jade Ellis 2025-06-29 15:07:04 +01:00 committed by Ellis Git
commit ecc6fda98b
3 changed files with 42 additions and 22 deletions

View file

@ -238,7 +238,11 @@ pub(super) async fn suspend(&self, user_id: String) -> Result {
if self.services.users.is_admin(&user_id).await {
return Err!("Admin users cannot be suspended.");
}
self.services.users.suspend_account(&user_id).await;
// TODO: Record the actual user that sent the suspension where possible
self.services
.users
.suspend_account(&user_id, self.services.globals.server_user.as_ref())
.await;
self.write_str(&format!("User {user_id} has been suspended."))
.await