use crate::sensitive::Sensitive;
use lemmy_db_schema::{
- newtypes::{CommentId, CommunityId, PersonId, PostId},
+ newtypes::{CommentId, CommunityId, LanguageId, PersonId, PostId},
+ source::{instance::Instance, language::Language, tagline::Tagline},
ListingType,
+ ModlogActionType,
+ RegistrationMode,
SearchType,
SortType,
};
use lemmy_db_views::structs::{
CommentView,
- LocalUserSettingsView,
+ CustomEmojiView,
+ LocalUserView,
PostView,
RegistrationApplicationView,
SiteView,
CommunityModeratorView,
CommunityView,
PersonBlockView,
- PersonViewSafe,
+ PersonView,
};
use lemmy_db_views_moderator::structs::{
AdminPurgeCommentView,
ModAddView,
ModBanFromCommunityView,
ModBanView,
+ ModFeaturePostView,
ModHideCommunityView,
ModLockPostView,
ModRemoveCommentView,
ModRemoveCommunityView,
ModRemovePostView,
- ModStickyPostView,
ModTransferCommunityView,
};
use serde::{Deserialize, Serialize};
pub comments: Vec<CommentView>,
pub posts: Vec<PostView>,
pub communities: Vec<CommunityView>,
- pub users: Vec<PersonViewSafe>,
+ pub users: Vec<PersonView>,
}
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct ResolveObject {
pub q: String,
- pub auth: Option<Sensitive<String>>,
+ pub auth: Sensitive<String>,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub comment: Option<CommentView>,
pub post: Option<PostView>,
pub community: Option<CommunityView>,
- pub person: Option<PersonViewSafe>,
+ pub person: Option<PersonView>,
}
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub page: Option<i64>,
pub limit: Option<i64>,
pub auth: Option<Sensitive<String>>,
+ pub type_: Option<ModlogActionType>,
+ pub other_person_id: Option<PersonId>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GetModlogResponse {
pub removed_posts: Vec<ModRemovePostView>,
pub locked_posts: Vec<ModLockPostView>,
- pub stickied_posts: Vec<ModStickyPostView>,
+ pub featured_posts: Vec<ModFeaturePostView>,
pub removed_comments: Vec<ModRemoveCommentView>,
pub removed_communities: Vec<ModRemoveCommunityView>,
pub banned_from_community: Vec<ModBanFromCommunityView>,
pub icon: Option<String>,
pub banner: Option<String>,
pub enable_downvotes: Option<bool>,
- pub open_registration: Option<bool>,
pub enable_nsfw: Option<bool>,
pub community_creation_admin_only: Option<bool>,
pub require_email_verification: Option<bool>,
- pub require_application: Option<bool>,
pub application_question: Option<String>,
pub private_instance: Option<bool>,
pub default_theme: Option<String>,
- pub default_post_listing_type: Option<String>,
+ pub default_post_listing_type: Option<ListingType>,
+ pub legal_information: Option<String>,
+ pub application_email_admins: Option<bool>,
+ pub hide_modlog_mod_names: Option<bool>,
+ pub discussion_languages: Option<Vec<LanguageId>>,
+ pub slur_filter_regex: Option<String>,
+ pub actor_name_max_length: Option<i32>,
+ pub rate_limit_message: Option<i32>,
+ pub rate_limit_message_per_second: Option<i32>,
+ pub rate_limit_post: Option<i32>,
+ pub rate_limit_post_per_second: Option<i32>,
+ pub rate_limit_register: Option<i32>,
+ pub rate_limit_register_per_second: Option<i32>,
+ pub rate_limit_image: Option<i32>,
+ pub rate_limit_image_per_second: Option<i32>,
+ pub rate_limit_comment: Option<i32>,
+ pub rate_limit_comment_per_second: Option<i32>,
+ pub rate_limit_search: Option<i32>,
+ pub rate_limit_search_per_second: Option<i32>,
+ pub federation_enabled: Option<bool>,
+ pub federation_debug: Option<bool>,
+ pub federation_worker_count: Option<i32>,
+ pub captcha_enabled: Option<bool>,
+ pub captcha_difficulty: Option<String>,
+ pub allowed_instances: Option<Vec<String>>,
+ pub blocked_instances: Option<Vec<String>>,
+ pub taglines: Option<Vec<String>>,
+ pub registration_mode: Option<RegistrationMode>,
pub auth: Sensitive<String>,
}
pub icon: Option<String>,
pub banner: Option<String>,
pub enable_downvotes: Option<bool>,
- pub open_registration: Option<bool>,
pub enable_nsfw: Option<bool>,
pub community_creation_admin_only: Option<bool>,
pub require_email_verification: Option<bool>,
- pub require_application: Option<bool>,
pub application_question: Option<String>,
pub private_instance: Option<bool>,
pub default_theme: Option<String>,
- pub default_post_listing_type: Option<String>,
+ pub default_post_listing_type: Option<ListingType>,
pub legal_information: Option<String>,
+ pub application_email_admins: Option<bool>,
+ pub hide_modlog_mod_names: Option<bool>,
+ pub discussion_languages: Option<Vec<LanguageId>>,
+ pub slur_filter_regex: Option<String>,
+ pub actor_name_max_length: Option<i32>,
+ pub rate_limit_message: Option<i32>,
+ pub rate_limit_message_per_second: Option<i32>,
+ pub rate_limit_post: Option<i32>,
+ pub rate_limit_post_per_second: Option<i32>,
+ pub rate_limit_register: Option<i32>,
+ pub rate_limit_register_per_second: Option<i32>,
+ pub rate_limit_image: Option<i32>,
+ pub rate_limit_image_per_second: Option<i32>,
+ pub rate_limit_comment: Option<i32>,
+ pub rate_limit_comment_per_second: Option<i32>,
+ pub rate_limit_search: Option<i32>,
+ pub rate_limit_search_per_second: Option<i32>,
+ pub federation_enabled: Option<bool>,
+ pub federation_debug: Option<bool>,
+ pub federation_worker_count: Option<i32>,
+ pub captcha_enabled: Option<bool>,
+ pub captcha_difficulty: Option<String>,
+ pub allowed_instances: Option<Vec<String>>,
+ pub blocked_instances: Option<Vec<String>>,
+ pub taglines: Option<Vec<String>>,
+ pub registration_mode: Option<RegistrationMode>,
+ pub reports_email_admins: Option<bool>,
pub auth: Sensitive<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct GetSiteResponse {
- pub site_view: Option<SiteView>, // Because the site might not be set up yet
- pub admins: Vec<PersonViewSafe>,
+ pub site_view: SiteView,
+ pub admins: Vec<PersonView>,
pub online: usize,
pub version: String,
pub my_user: Option<MyUserInfo>,
+ pub all_languages: Vec<Language>,
+ pub discussion_languages: Vec<LanguageId>,
+ pub taglines: Vec<Tagline>,
+ pub custom_emojis: Vec<CustomEmojiView>,
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct GetFederatedInstances {}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct GetFederatedInstancesResponse {
pub federated_instances: Option<FederatedInstances>, // Federation may be disabled
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct MyUserInfo {
- pub local_user_view: LocalUserSettingsView,
+ pub local_user_view: LocalUserView,
pub follows: Vec<CommunityFollowerView>,
pub moderates: Vec<CommunityModeratorView>,
pub community_blocks: Vec<CommunityBlockView>,
pub person_blocks: Vec<PersonBlockView>,
+ pub discussion_languages: Vec<LanguageId>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct FederatedInstances {
- pub linked: Vec<String>,
- pub allowed: Option<Vec<String>>,
- pub blocked: Option<Vec<String>>,
+ pub linked: Vec<Instance>,
+ pub allowed: Option<Vec<Instance>>,
+ pub blocked: Option<Vec<Instance>>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]