mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 08:55:16 +00:00
Can get notification settings
This commit is contained in:
@ -68,4 +68,5 @@ pub mod call_peer_interrupted_streaming;
|
||||
pub mod res_check_password_token;
|
||||
pub mod removed_user_from_conv_message;
|
||||
pub mod user_is_writing_message_in_conversation;
|
||||
pub mod res_create_conversation_for_group;
|
||||
pub mod res_create_conversation_for_group;
|
||||
pub mod notification_settings_api;
|
20
src/api_data/notification_settings_api.rs
Normal file
20
src/api_data/notification_settings_api.rs
Normal file
@ -0,0 +1,20 @@
|
||||
//! # Notification settings API
|
||||
//!
|
||||
//! @author Pierre Hubert
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::data::user::User;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct NotificationSettingsAPI {
|
||||
allow_conversations: bool,
|
||||
}
|
||||
|
||||
impl NotificationSettingsAPI {
|
||||
pub fn new(user: &User) -> Self {
|
||||
Self {
|
||||
allow_conversations: user.allow_notif_conv
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user