Skip to content
Snippets Groups Projects
Commit b5b81818 authored by Andrej Kacian's avatar Andrej Kacian
Browse files

Notify admin room for user registrations, deactivations and password changes

parent 738f5e8f
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
},
events::{
room::member::{MembershipState, RoomMemberEventContent},
room::message::RoomMessageEventContent,
EventType,
},
push, UserId,
......@@ -230,7 +231,12 @@ pub async fn register_route(
body.initial_device_display_name.clone(),
)?;
info!("{} registered on this server", user_id);
info!("New user {} registered on this server.", user_id);
db.admin
.send_message(RoomMessageEventContent::notice_plain(format!(
"New user {} registered on this server.",
user_id
)));
// If this is the first real user, grant them admin privileges
// Note: the server user, @conduit:servername, is generated first
......@@ -319,6 +325,13 @@ pub async fn change_password_route(
db.flush()?;
info!("User {} changed their password.", sender_user);
db.admin
.send_message(RoomMessageEventContent::notice_plain(format!(
"User {} changed their password.",
sender_user
)));
Ok(change_password::v3::Response {})
}
......@@ -436,7 +449,12 @@ pub async fn deactivate_route(
// Remove devices and mark account as deactivated
db.users.deactivate_account(sender_user)?;
info!("{} deactivated their account", sender_user);
info!("User {} deactivated their account.", sender_user);
db.admin
.send_message(RoomMessageEventContent::notice_plain(format!(
"User {} deactivated their account.",
sender_user
)));
db.flush()?;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment