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

Start to push notifications

This commit is contained in:
2021-01-23 14:52:05 +01:00
parent 0e80564f85
commit 4d6ff8fef3
7 changed files with 213 additions and 3 deletions

View File

@ -211,6 +211,11 @@ impl PartialNotification {
self.id.is_some()
}
pub fn set_time_create(mut self, time: u64) -> PartialNotification {
self.time_create = Some(time);
self
}
pub fn set_dest_user_id(mut self, id: &UserID) -> PartialNotification {
self.dest_user_id = Some(id.clone());
self
@ -230,4 +235,9 @@ impl PartialNotification {
self.on_elem_type = Some(t);
self
}
pub fn set_type(mut self, t: NotifEventType) -> PartialNotification {
self.kind = Some(t);
self
}
}

View File

@ -153,6 +153,11 @@ impl Post {
_ => false,
}
}
/// Check out whether a post is targeting a group page or not
pub fn is_on_group_page(&self) -> bool {
matches!(self.target_page, PostPageKind::PAGE_KIND_GROUP(_))
}
}
#[cfg(test)]