summaryrefslogtreecommitdiffstats
path: root/server/src/api/post.rs
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2020-03-14 13:15:23 +0100
committerFelix Ableitner <me@nutomic.com>2020-03-14 13:15:23 +0100
commit5896a9d251f13e4387fe34e0f8cd21317494ec15 (patch)
tree4a8a66135602f4cbc8375926559dece271d2c90d /server/src/api/post.rs
parentb01f4f75d6dbbc579099422ccb2a897899dfe343 (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.rs7
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),