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:
@ -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
|
||||
}
|
||||
}
|
@ -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)]
|
||||
|
Reference in New Issue
Block a user