mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
1 parent
00c054d356
commit
296a4b92d6
2 files changed
+6
-1
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
Use exists instead of contains to save writing to a buffer in src/service/users/mod.rs: is_login_disabled. Contributed by @aprilgrimoire.
|
||||||
@@ -304,7 +304,11 @@ impl Service {
|
|||||||
pub fn enable_login(&self, user_id: &UserId) { self.db.userid_logindisabled.remove(user_id); }
|
pub fn enable_login(&self, user_id: &UserId) { self.db.userid_logindisabled.remove(user_id); }
|
||||||
|
|
||||||
pub async fn is_login_disabled(&self, user_id: &UserId) -> bool {
|
pub async fn is_login_disabled(&self, user_id: &UserId) -> bool {
|
||||||
self.db.userid_logindisabled.contains(user_id).await
|
self.db
|
||||||
|
.userid_logindisabled
|
||||||
|
.exists(user_id.as_str())
|
||||||
|
.await
|
||||||
|
.is_ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if account is active, infallible
|
/// Check if account is active, infallible
|
||||||
|
|||||||
Reference in new issue
Block a user