summaryrefslogtreecommitdiffstats
path: root/server/src/api/community.rs
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2020-03-14 22:03:05 +0100
committerFelix Ableitner <me@nutomic.com>2020-03-14 22:03:05 +0100
commit8ebcc7ac021963ad3c5284bdf7fa3197c49223ed (patch)
treed94df574e0eb82087ad9b009ff946171c440dfbf /server/src/api/community.rs
parent5896a9d251f13e4387fe34e0f8cd21317494ec15 (diff)
Implemented basics for post federation, plus a bunch of other stuff
Diffstat (limited to 'server/src/api/community.rs')
-rw-r--r--server/src/api/community.rs6
1 files changed, 4 insertions, 2 deletions
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<i64>,
limit: Option<i64>,
auth: Option<String>,
+ local_only: Option<bool>,
}
#[derive(Serialize, Deserialize, Debug)]
@@ -342,7 +343,8 @@ impl Perform<ListCommunitiesResponse> for Oper<ListCommunities> {
fn perform(&self, conn: &PgConnection) -> Result<ListCommunitiesResponse, Error> {
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()?,
});