diff options
author | Felix Ableitner <me@nutomic.com> | 2020-03-14 13:15:23 +0100 |
---|---|---|
committer | Felix Ableitner <me@nutomic.com> | 2020-03-14 13:15:23 +0100 |
commit | 5896a9d251f13e4387fe34e0f8cd21317494ec15 (patch) | |
tree | 4a8a66135602f4cbc8375926559dece271d2c90d /server/src/api/post.rs | |
parent | b01f4f75d6dbbc579099422ccb2a897899dfe343 (diff) |
Move apub related code from websocket into api package
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r-- | server/src/api/post.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/src/api/post.rs b/server/src/api/post.rs index cefa5b07..e19d4ee9 100644 --- a/server/src/api/post.rs +++ b/server/src/api/post.rs @@ -1,4 +1,5 @@ use super::*; +use crate::settings::Settings; use diesel::PgConnection; use std::str::FromStr; @@ -220,6 +221,12 @@ impl Perform<GetPostsResponse> for Oper<GetPosts> { fn perform(&self, conn: &PgConnection) -> Result<GetPostsResponse, Error> { let data: &GetPosts = &self.data; + if Settings::get().federation_enabled { + dbg!(&data); + // TODO: intercept here (but the type is wrong) + //get_remote_community_posts(get_posts.community_id.unwrap()) + } + let user_claims: Option<Claims> = match &data.auth { Some(auth) => match Claims::decode(&auth) { Ok(claims) => Some(claims.claims), |