From b7103a7e1481e8d7fb2a36938faba520a8cbe013 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 7 Apr 2020 18:47:19 +0200 Subject: Store remote communities/posts in db, federate posts! --- server/src/api/post.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'server/src/api/post.rs') diff --git a/server/src/api/post.rs b/server/src/api/post.rs index cfb71941..18c33dc1 100644 --- a/server/src/api/post.rs +++ b/server/src/api/post.rs @@ -1,5 +1,4 @@ use super::*; -use crate::settings::Settings; use diesel::PgConnection; use std::str::FromStr; @@ -133,6 +132,7 @@ impl Perform for Oper { thumbnail_url: pictshare_thumbnail, ap_id: "changeme".into(), local: true, + published: None, }; let inserted_post = match Post::create(&conn, &post_form) { @@ -228,11 +228,6 @@ impl Perform for Oper { fn perform(&self, conn: &PgConnection) -> Result { let data: &GetPosts = &self.data; - if Settings::get().federation.enabled { - // TODO: intercept here (but the type is wrong) - //get_remote_community_posts(get_posts.community_id.unwrap()) - } - let user_claims: Option = match &data.auth { Some(auth) => match Claims::decode(&auth) { Ok(claims) => Some(claims.claims), @@ -398,6 +393,7 @@ impl Perform for Oper { thumbnail_url: pictshare_thumbnail, ap_id: read_post.ap_id, local: read_post.local, + published: None, }; let _updated_post = match Post::update(&conn, data.edit_id, &post_form) { -- cgit v1.2.3