add constructor for users service

This commit is contained in:
Charles Hall 2024-10-08 16:36:26 -07:00
parent f771d319b2
commit e06d126d4e
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 9 additions and 8 deletions

View file

@ -46,6 +46,13 @@ pub(crate) struct Service {
}
impl Service {
pub(crate) fn new(db: &'static dyn Data) -> Self {
Self {
db,
connections: Mutex::new(BTreeMap::new()),
}
}
/// Check if a user has an account on this homeserver.
pub(crate) fn exists(&self, user_id: &UserId) -> Result<bool> {
self.db.exists(user_id)