mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-25 23:09:22 +00:00
Add new setting
This commit is contained in:
parent
e725d24104
commit
138142f52d
@ -9,12 +9,14 @@ 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_conversations: user.allow_notif_conv,
|
||||
allow_notifications_sound: user.allow_notif_sound,
|
||||
}
|
||||
}
|
||||
}
|
@ -132,6 +132,7 @@ pub struct User {
|
||||
|
||||
/// Notifications settings
|
||||
pub allow_notif_conv: bool,
|
||||
pub allow_notif_sound: bool,
|
||||
}
|
||||
|
||||
impl User {
|
||||
|
@ -89,6 +89,7 @@ fn db_to_user(res: &database::RowResult) -> ResultBoxError<User> {
|
||||
delete_likes_after: res.get_optional_positive_u64("delete_likes_after")?,
|
||||
|
||||
// Conversation settings
|
||||
allow_notif_sound: res.get_legacy_bool("allow_notif_sound")?,
|
||||
allow_notif_conv: res.get_legacy_bool("allow_notif_conv")?,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user