1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 21:39:21 +00:00
comunicapiv3/src/api_data/notification_settings_api.rs
2021-04-10 19:20:03 +02:00

22 lines
465 B
Rust

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