fix: Correctly check for local users' existence

This commit is contained in:
Ginger
2026-05-08 11:48:20 -04:00
parent ebf9a08cd1
commit f091d3a732
3 changed files with 6 additions and 7 deletions
+4 -2
View File
@@ -255,10 +255,12 @@ impl Service {
pub async fn unlock_account(&self, user_id: &UserId) { self.db.userid_lock.remove(user_id); }
/// Check if a user has an account on this homeserver.
/// Check if the provided user ID belongs to an existing (possibly
/// deactivated) account on this homeserver.
#[inline]
pub async fn exists(&self, user_id: &UserId) -> bool {
self.db.userid_password.get(user_id).await.is_ok()
self.services.globals.user_is_local(&user_id)
&& self.db.userid_password.get(user_id).await.is_ok()
}
/// Check if account is deactivated