diff options
Diffstat (limited to 'src/service/rooms/threads/data.rs')
-rw-r--r-- | src/service/rooms/threads/data.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/service/rooms/threads/data.rs b/src/service/rooms/threads/data.rs new file mode 100644 index 0000000..9221e8e --- /dev/null +++ b/src/service/rooms/threads/data.rs @@ -0,0 +1,15 @@ +use crate::{PduEvent, Result}; +use ruma::{api::client::threads::get_threads::v1::IncludeThreads, OwnedUserId, RoomId, UserId}; + +pub trait Data: Send + Sync { + fn threads_until<'a>( + &'a self, + user_id: &'a UserId, + room_id: &'a RoomId, + until: u64, + include: &'a IncludeThreads, + ) -> Result<Box<dyn Iterator<Item = Result<(u64, PduEvent)>> + 'a>>; + + fn update_participants(&self, root_id: &[u8], participants: &[OwnedUserId]) -> Result<()>; + fn get_participants(&self, root_id: &[u8]) -> Result<Option<Vec<OwnedUserId>>>; +} |