mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
chore: Move registration notice logic
This commit is contained in:
5 files changed
+39
-33
No files matched your search
@@ -95,7 +95,13 @@ pub(crate) async fn register_route(
|
||||
|
||||
services
|
||||
.users
|
||||
.create_local_account(&user_id, Some(password), identity.email)
|
||||
.create_local_account(
|
||||
&user_id,
|
||||
Some(password),
|
||||
identity.email,
|
||||
Some(&client),
|
||||
body.initial_device_display_name.as_deref(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
user_id
|
||||
@@ -132,26 +138,6 @@ pub(crate) async fn register_route(
|
||||
};
|
||||
|
||||
debug_info!(%user_id, ?device, "New account created via legacy registration");
|
||||
// Only log if the user wasn't registered via an appservice.
|
||||
if body.identity.is_none() {
|
||||
let notice = if device.is_some()
|
||||
&& let Some(device_name) = body.initial_device_display_name.as_ref()
|
||||
{
|
||||
format!(
|
||||
"New user \"{user_id}\" registered on this server from IP {client} and device \
|
||||
display name \"{device_name}\" via legacy registration",
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"New user \"{user_id}\" registered on this server from IP {client} via legacy \
|
||||
registration."
|
||||
)
|
||||
};
|
||||
info!("{notice}");
|
||||
if services.server.config.admin_room_notices {
|
||||
services.admin.notice(¬ice).await;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(assign!(register::v3::Response::new(user_id), {
|
||||
access_token: token.map(DeviceToken::into_token),
|
||||
|
||||
Reference in new issue
Block a user