continuwuity/src/utils/user_id.rs
strawberry 9931e60050 use single global function for server name local and user local checking
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-05-03 01:52:29 -04:00

8 lines
286 B
Rust

//! utilities for doing things with UserId's / usernames
use ruma::UserId;
use crate::services;
/// checks if `user_id` is local to us via server_name comparison
pub(crate) fn user_is_local(user_id: &UserId) -> bool { user_id.server_name() == services().globals.config.server_name }