use lemmy_db_schema::{
newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId},
CommentSortType,
+ ListingType,
SortType,
};
use lemmy_db_views::structs::{CommentView, PostView};
CommentReplyView,
CommunityModeratorView,
PersonMentionView,
- PersonViewSafe,
+ PersonView,
};
use serde::{Deserialize, Serialize};
pub struct Login {
pub username_or_email: Sensitive<String>,
pub password: Sensitive<String>,
+ pub totp_2fa_token: Option<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub show_nsfw: Option<bool>,
pub show_scores: Option<bool>,
pub theme: Option<String>,
- pub default_sort_type: Option<i16>,
- pub default_listing_type: Option<i16>,
+ pub default_sort_type: Option<SortType>,
+ pub default_listing_type: Option<ListingType>,
pub interface_language: Option<String>,
pub avatar: Option<String>,
pub banner: Option<String>,
pub show_read_posts: Option<bool>,
pub show_new_post_notifs: Option<bool>,
pub discussion_languages: Option<Vec<LanguageId>>,
+ /// None leaves it as is, true will generate or regenerate it, false clears it out
+ pub generate_totp_2fa: Option<bool>,
pub auth: Sensitive<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GetPersonDetailsResponse {
- pub person_view: PersonViewSafe,
+ pub person_view: PersonView,
pub comments: Vec<CommentView>,
pub posts: Vec<PostView>,
pub moderates: Vec<CommunityModeratorView>,
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct AddAdminResponse {
- pub admins: Vec<PersonViewSafe>,
+ pub admins: Vec<PersonView>,
}
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BannedPersonsResponse {
- pub banned: Vec<PersonViewSafe>,
+ pub banned: Vec<PersonView>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BanPersonResponse {
- pub person_view: PersonViewSafe,
+ pub person_view: PersonView,
pub banned: bool,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BlockPersonResponse {
- pub person_view: PersonViewSafe,
+ pub person_view: PersonView,
pub blocked: bool,
}