1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 00:45:18 +00:00

Start to implement the mark_seen method

This commit is contained in:
2020-07-11 13:29:12 +02:00
parent 87718076e7
commit 7519ce59fc
5 changed files with 159 additions and 12 deletions

View File

@ -151,4 +151,46 @@ pub struct Notification {
pub visibility: NotifEventVisibility,
pub container_id: Option<u64>,
pub container_type: Option<NotifElemType>,
}
pub struct PartialNotification {
pub id: Option<u64>,
pub time_create: Option<u64>,
pub seen: Option<bool>,
pub from_user_id: Option<UserID>,
pub dest_user_id: Option<UserID>,
pub on_elem_id: Option<u64>,
pub on_elem_type: Option<NotifElemType>,
pub kind: Option<NotifEventType>,
pub visibility: Option<NotifEventVisibility>,
pub container_id: Option<u64>,
pub container_type: Option<NotifElemType>,
}
impl PartialNotification {
pub fn new() -> PartialNotification {
PartialNotification {
id: None,
time_create: None,
seen: None,
from_user_id: None,
dest_user_id: None,
on_elem_id: None,
on_elem_type: None,
kind: None,
visibility: None,
container_id: None,
container_type: None,
}
}
pub fn set_id(mut self, id: u64) -> PartialNotification {
self.id = Some(id);
self
}
pub fn set_dest_user_id(mut self, id: &UserID) -> PartialNotification {
self.dest_user_id = Some(id.clone());
self
}
}