1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-17 14:00:50 +01:00

fix: allow reactivation of users using reset-password admin command

This commit is contained in:
Timo Kösters 2023-02-11 12:43:41 +01:00
parent a4f18f99ad
commit fc0aff20cf
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB

View file

@ -556,7 +556,6 @@ impl Service {
// Check if the specified user is valid // Check if the specified user is valid
if !services().users.exists(&user_id)? if !services().users.exists(&user_id)?
|| services().users.is_deactivated(&user_id)?
|| user_id || user_id
== UserId::parse_with_server_name( == UserId::parse_with_server_name(
"conduit", "conduit",
@ -565,7 +564,7 @@ impl Service {
.expect("conduit user exists") .expect("conduit user exists")
{ {
return Ok(RoomMessageEventContent::text_plain( return Ok(RoomMessageEventContent::text_plain(
"The specified user does not exist or is deactivated!", "The specified user does not exist!",
)); ));
} }
@ -600,12 +599,12 @@ impl Service {
}; };
if user_id.is_historical() { if user_id.is_historical() {
return Ok(RoomMessageEventContent::text_plain(format!( return Ok(RoomMessageEventContent::text_plain(format!(
"userid {user_id} is not allowed due to historical" "Userid {user_id} is not allowed due to historical"
))); )));
} }
if services().users.exists(&user_id)? { if services().users.exists(&user_id)? {
return Ok(RoomMessageEventContent::text_plain(format!( return Ok(RoomMessageEventContent::text_plain(format!(
"userid {user_id} already exists" "Userid {user_id} already exists"
))); )));
} }
// Create user // Create user