mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 08:25:16 +00:00
Build first notifications
This commit is contained in:
@ -38,4 +38,5 @@ pub mod new_custom_emoji;
|
||||
pub mod user_ws_message;
|
||||
pub mod user_ws_connection;
|
||||
pub mod call_signal;
|
||||
pub mod new_notifications_settings;
|
||||
pub mod new_notifications_settings;
|
||||
pub mod push_notification;
|
14
src/data/push_notification.rs
Normal file
14
src/data/push_notification.rs
Normal file
@ -0,0 +1,14 @@
|
||||
//! # Push notification
|
||||
//!
|
||||
//! Notification pushed to registered devices
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PushNotification {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub body: String,
|
||||
pub image: Option<String>,
|
||||
pub timeout: Option<u64>,
|
||||
}
|
@ -36,6 +36,11 @@ impl UserID {
|
||||
false => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Create an owned instance of this user ID object
|
||||
pub fn as_owned(&self) -> Self {
|
||||
Self(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl Hash for UserID {
|
||||
@ -136,6 +141,10 @@ pub struct User {
|
||||
}
|
||||
|
||||
impl User {
|
||||
pub fn full_name(&self) -> String {
|
||||
format!("{} {}", self.first_name, self.last_name)
|
||||
}
|
||||
|
||||
/// Check if user's page is public
|
||||
pub fn is_page_public(&self) -> bool {
|
||||
!matches!(self.status, UserPageStatus::PRIVATE)
|
||||
|
Reference in New Issue
Block a user