2022-10-09 17:25:06 +02:00
|
|
|
use ruma::{OwnedRoomId, OwnedUserId, RoomId, UserId};
|
2022-09-07 13:25:51 +02:00
|
|
|
|
|
|
|
|
use crate::Result;
|
2024-03-05 19:48:54 -05:00
|
|
|
|
2024-05-09 15:59:08 -07:00
|
|
|
pub trait Data: Send + Sync {
|
2022-08-14 13:38:21 +02:00
|
|
|
fn reset_notification_counts(&self, user_id: &UserId, room_id: &RoomId) -> Result<()>;
|
2021-04-12 12:40:16 +02:00
|
|
|
|
2022-08-14 13:38:21 +02:00
|
|
|
fn notification_count(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64>;
|
2021-04-12 12:40:16 +02:00
|
|
|
|
2022-08-14 13:38:21 +02:00
|
|
|
fn highlight_count(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64>;
|
2021-04-13 15:00:45 +02:00
|
|
|
|
2022-10-30 20:36:14 +01:00
|
|
|
// Returns the count at which the last reset_notification_counts was called
|
|
|
|
|
fn last_notification_read(&self, user_id: &UserId, room_id: &RoomId) -> Result<u64>;
|
|
|
|
|
|
2022-08-14 13:38:21 +02:00
|
|
|
fn associate_token_shortstatehash(&self, room_id: &RoomId, token: u64, shortstatehash: u64) -> Result<()>;
|
2021-06-17 20:44:29 +02:00
|
|
|
|
2022-08-14 13:38:21 +02:00
|
|
|
fn get_token_shortstatehash(&self, room_id: &RoomId, token: u64) -> Result<Option<u64>>;
|
2021-06-17 20:44:29 +02:00
|
|
|
|
2022-08-14 13:38:21 +02:00
|
|
|
fn get_shared_rooms<'a>(
|
2022-10-09 17:25:06 +02:00
|
|
|
&'a self, users: Vec<OwnedUserId>,
|
|
|
|
|
) -> Result<Box<dyn Iterator<Item = Result<OwnedRoomId>> + 'a>>;
|
2022-08-14 13:38:21 +02:00
|
|
|
}
|