Query and set seen status via store

This commit is contained in:
Joscha 2022-08-08 15:00:20 +02:00
parent 20ec6ef3b3
commit ff4118e21d
4 changed files with 48 additions and 1 deletions

View file

@ -9,6 +9,7 @@ pub trait Msg {
type Id: Clone + Debug + Hash + Eq + Ord;
fn id(&self) -> Self::Id;
fn parent(&self) -> Option<Self::Id>;
fn seen(&self) -> bool;
fn last_possible_id() -> Self::Id;
}
@ -128,4 +129,5 @@ pub trait MsgStore<M: Msg> {
async fn newest_msg_id(&self) -> Option<M::Id>;
async fn older_msg_id(&self, id: &M::Id) -> Option<M::Id>;
async fn newer_msg_id(&self, id: &M::Id) -> Option<M::Id>;
async fn set_seen(&self, id: &M::Id, seen: bool);
}