lang: data.lang.to_owned(),
show_avatars: data.show_avatars,
show_read_posts: data.show_read_posts,
+ show_new_post_notifs: data.show_new_post_notifs,
send_notifications_to_email: data.send_notifications_to_email,
};
pub bot_account: Option<bool>,
pub show_bot_accounts: Option<bool>,
pub show_read_posts: Option<bool>,
+ pub show_new_post_notifs: Option<bool>,
pub auth: String,
}
.map_err(|_| ApiError::err("user_already_exists"))?;
// Create the local user
+ // TODO some of these could probably use the DB defaults
let local_user_form = LocalUserForm {
person_id: inserted_person.id,
email: Some(data.email.to_owned()),
show_avatars: Some(true),
show_scores: Some(true),
show_read_posts: Some(true),
+ show_new_post_notifs: Some(false),
send_notifications_to_email: Some(false),
};
show_bot_accounts,
show_scores,
show_read_posts,
+ show_new_post_notifs,
);
impl ToSafeSettings for LocalUser {
show_bot_accounts,
show_scores,
show_read_posts,
+ show_new_post_notifs,
)
}
}
show_bot_accounts -> Bool,
show_scores -> Bool,
show_read_posts -> Bool,
+ show_new_post_notifs -> Bool,
}
}
pub show_bot_accounts: bool,
pub show_scores: bool,
pub show_read_posts: bool,
+ pub show_new_post_notifs: bool,
}
// TODO redo these, check table defaults
pub show_bot_accounts: Option<bool>,
pub show_scores: Option<bool>,
pub show_read_posts: Option<bool>,
+ pub show_new_post_notifs: Option<bool>,
}
/// A local user view that removes password encrypted
pub show_bot_accounts: bool,
pub show_scores: bool,
pub show_read_posts: bool,
+ pub show_new_post_notifs: bool,
}
--- /dev/null
+alter table local_user drop column show_new_post_notifs;
--- /dev/null
+alter table local_user add column show_new_post_notifs boolean default false not null;