X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi_common%2Fsrc%2Fsite.rs;h=a5b2afae297fccc7270210bbc7055fe99456751e;hb=HEAD;hp=2d3ebbe0b0d1a74ec7020824c1c81c2da7191ff8;hpb=32a5567cbffbc540e19dca61d370b9d078e37d30;p=lemmy.git diff --git a/crates/api_common/src/site.rs b/crates/api_common/src/site.rs index 2d3ebbe0..a5b2afae 100644 --- a/crates/api_common/src/site.rs +++ b/crates/api_common/src/site.rs @@ -2,44 +2,20 @@ use crate::sensitive::Sensitive; use lemmy_db_schema::{ newtypes::{CommentId, CommunityId, LanguageId, PersonId, PostId}, source::{instance::Instance, language::Language, tagline::Tagline}, - ListingType, - ModlogActionType, - RegistrationMode, - SearchType, - SortType, + ListingType, ModlogActionType, RegistrationMode, SearchType, SortType, }; use lemmy_db_views::structs::{ - CommentView, - CustomEmojiView, - LocalUserView, - PostView, - RegistrationApplicationView, - SiteView, + CommentView, CustomEmojiView, LocalUserView, PostView, RegistrationApplicationView, SiteView, }; use lemmy_db_views_actor::structs::{ - CommunityBlockView, - CommunityFollowerView, - CommunityModeratorView, - CommunityView, - PersonBlockView, - PersonView, + CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, + PersonBlockView, PersonView, }; use lemmy_db_views_moderator::structs::{ - AdminPurgeCommentView, - AdminPurgeCommunityView, - AdminPurgePersonView, - AdminPurgePostView, - ModAddCommunityView, - ModAddView, - ModBanFromCommunityView, - ModBanView, - ModFeaturePostView, - ModHideCommunityView, - ModLockPostView, - ModRemoveCommentView, - ModRemoveCommunityView, - ModRemovePostView, - ModTransferCommunityView, + AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView, + ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModFeaturePostView, + ModHideCommunityView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, + ModRemovePostView, ModTransferCommunityView, }; use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; @@ -84,7 +60,7 @@ pub struct SearchResponse { pub struct ResolveObject { /// Can be the full url, or a shortened version like: !fediverse@lemmy.ml pub q: String, - pub auth: Sensitive, + pub auth: Option>, } #[skip_serializing_none] @@ -150,6 +126,7 @@ pub struct CreateSite { pub icon: Option, pub banner: Option, pub enable_downvotes: Option, + pub enable_federated_downvotes: Option, pub enable_nsfw: Option, pub community_creation_admin_only: Option, pub require_email_verification: Option, @@ -177,7 +154,6 @@ pub struct CreateSite { pub rate_limit_search_per_second: Option, pub federation_enabled: Option, pub federation_debug: Option, - pub federation_worker_count: Option, pub captcha_enabled: Option, pub captcha_difficulty: Option, pub allowed_instances: Option>, @@ -203,6 +179,8 @@ pub struct EditSite { pub banner: Option, /// Whether to enable downvotes. pub enable_downvotes: Option, + /// Whether to allow downvotes from federated sites. + pub enable_federated_downvotes: Option, /// Whether to enable NSFW. pub enable_nsfw: Option, /// Limits community creation to admins only. @@ -250,8 +228,6 @@ pub struct EditSite { pub federation_enabled: Option, /// Enables federation debugging. pub federation_debug: Option, - /// The number of federation workers. - pub federation_worker_count: Option, /// Whether to enable captchas for signups. pub captcha_enabled: Option, /// The captcha difficulty. Can be easy, medium, or hard @@ -283,6 +259,7 @@ pub struct GetSite { /// The response for a site. pub struct SiteResponse { pub site_view: SiteView, + pub taglines: Vec, } #[skip_serializing_none] @@ -293,7 +270,6 @@ pub struct SiteResponse { pub struct GetSiteResponse { pub site_view: SiteView, pub admins: Vec, - pub online: usize, pub version: String, pub my_user: Option, pub all_languages: Vec, @@ -398,7 +374,7 @@ pub struct PurgeComment { pub auth: Sensitive, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] #[cfg_attr(feature = "full", derive(TS))] #[cfg_attr(feature = "full", ts(export))] /// The response for purged items.