Add state_cache iteration for local pending invitees to room.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#![type_length_limit = "65536"] //TODO: REDUCE ME
|
#![type_length_limit = "163840"] //TODO: REDUCE ME
|
||||||
#![allow(clippy::toplevel_ref_arg)]
|
#![allow(clippy::toplevel_ref_arg)]
|
||||||
|
|
||||||
pub mod client;
|
pub mod client;
|
||||||
|
|||||||
@@ -257,10 +257,22 @@ pub async fn room_knocked_count(&self, room_id: &RoomId) -> Result<u64> {
|
|||||||
.deserialized()
|
.deserialized()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns an iterator of all our local joined users in a room who are
|
||||||
|
/// active (not deactivated, not guest)
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
#[tracing::instrument(skip(self), level = "debug")]
|
#[tracing::instrument(skip(self), level = "debug")]
|
||||||
|
pub fn active_local_users_in_room<'a>(
|
||||||
|
&'a self,
|
||||||
|
room_id: &'a RoomId,
|
||||||
|
) -> impl Stream<Item = &UserId> + Send + 'a {
|
||||||
|
self.local_users_in_room(room_id)
|
||||||
|
.filter(|user| self.services.users.is_active(user))
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns an iterator of all our local users in the room, even if they're
|
/// Returns an iterator of all our local users in the room, even if they're
|
||||||
/// deactivated/guests
|
/// deactivated/guests
|
||||||
|
#[implement(Service)]
|
||||||
|
#[tracing::instrument(skip(self), level = "debug")]
|
||||||
pub fn local_users_in_room<'a>(
|
pub fn local_users_in_room<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
room_id: &'a RoomId,
|
room_id: &'a RoomId,
|
||||||
@@ -269,16 +281,15 @@ pub fn local_users_in_room<'a>(
|
|||||||
.ready_filter(|user| self.services.globals.user_is_local(user))
|
.ready_filter(|user| self.services.globals.user_is_local(user))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator of all our local joined users in a room who are
|
/// Returns an iterator of only our users invited to this room.
|
||||||
/// active (not deactivated, not guest)
|
|
||||||
#[implement(Service)]
|
#[implement(Service)]
|
||||||
#[tracing::instrument(skip(self), level = "trace")]
|
#[tracing::instrument(skip(self), level = "debug")]
|
||||||
pub fn active_local_users_in_room<'a>(
|
pub fn local_users_invited_to_room<'a>(
|
||||||
&'a self,
|
&'a self,
|
||||||
room_id: &'a RoomId,
|
room_id: &'a RoomId,
|
||||||
) -> impl Stream<Item = &UserId> + Send + 'a {
|
) -> impl Stream<Item = &UserId> + Send + 'a {
|
||||||
self.local_users_in_room(room_id)
|
self.room_members_invited(room_id)
|
||||||
.filter(|user| self.services.users.is_active(user))
|
.ready_filter(|user| self.services.globals.user_is_local(user))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator over all User IDs who ever joined a room.
|
/// Returns an iterator over all User IDs who ever joined a room.
|
||||||
|
|||||||
Reference in New Issue
Block a user