mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-03-23 22:20:45 +00:00
20 lines
364 B
Rust
20 lines
364 B
Rust
|
//! # 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
|
||
|
}
|
||
|
}
|
||
|
}
|