From 8ebcc7ac021963ad3c5284bdf7fa3197c49223ed Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 14 Mar 2020 22:03:05 +0100 Subject: Implemented basics for post federation, plus a bunch of other stuff --- server/src/api/community.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/src/api/community.rs') diff --git a/server/src/api/community.rs b/server/src/api/community.rs index 0f104c2d..a07b15d7 100644 --- a/server/src/api/community.rs +++ b/server/src/api/community.rs @@ -34,12 +34,13 @@ pub struct CommunityResponse { pub community: CommunityView, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct ListCommunities { sort: String, page: Option, limit: Option, auth: Option, + local_only: Option, } #[derive(Serialize, Deserialize, Debug)] @@ -342,7 +343,8 @@ impl Perform for Oper { fn perform(&self, conn: &PgConnection) -> Result { let data: &ListCommunities = &self.data; - if Settings::get().federation_enabled { + let local_only = data.local_only.unwrap_or(false); + if Settings::get().federation_enabled && !local_only { return Ok(ListCommunitiesResponse { communities: get_all_communities()?, }); -- cgit v1.2.3