mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
18 lines
565 B
Rust
18 lines
565 B
Rust
use conduwuit::utils::stream::TryIgnore;
|
|
use futures::Stream;
|
|
use ruma::{OwnedUserId, UserId};
|
|
|
|
impl super::Service {
|
|
/// Record the existence of a remote user.
|
|
pub fn record_remote_user(&self, user_id: &UserId) {
|
|
assert!(!self.services.globals.user_is_local(user_id), "user is not remote");
|
|
|
|
self.db.remoteuserid_remoteuser.insert(user_id, "");
|
|
}
|
|
|
|
/// Returns a stream over all remote users this server has ever seen.
|
|
pub fn stream_remote_users(&self) -> impl Stream<Item = OwnedUserId> + Send {
|
|
self.db.remoteuserid_remoteuser.keys().ignore_err()
|
|
}
|
|
}
|