1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-26 23:39:22 +00:00
comunicapiv3/src/api_data/notification_settings_api.rs

22 lines
465 B
Rust
Raw Normal View History

2021-04-10 17:12:46 +00:00
//! # Notification settings API
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::user::User;
#[derive(Serialize)]
pub struct NotificationSettingsAPI {
allow_conversations: bool,
2021-04-10 17:20:03 +00:00
allow_notifications_sound: bool,
2021-04-10 17:12:46 +00:00
}
impl NotificationSettingsAPI {
pub fn new(user: &User) -> Self {
Self {
2021-04-10 17:20:03 +00:00
allow_conversations: user.allow_notif_conv,
allow_notifications_sound: user.allow_notif_sound,
2021-04-10 17:12:46 +00:00
}
}
}