diff options
author | Felix Ableitner <me@nutomic.com> | 2020-04-07 18:47:19 +0200 |
---|---|---|
committer | Felix Ableitner <me@nutomic.com> | 2020-04-07 18:47:19 +0200 |
commit | b7103a7e1481e8d7fb2a36938faba520a8cbe013 (patch) | |
tree | 5645115f978f5053e991890a18a1536a2ef0131b /server/src/api/post.rs | |
parent | 1b0da74b57975d01ea166f45ea1fcacf4f1651dd (diff) |
Store remote communities/posts in db, federate posts!
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r-- | server/src/api/post.rs | 8 |
1 files changed, 2 insertions, 6 deletions
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<PostResponse> for Oper<CreatePost> { 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<GetPostsResponse> for Oper<GetPosts> { fn perform(&self, conn: &PgConnection) -> Result<GetPostsResponse, Error> { 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<Claims> = match &data.auth { Some(auth) => match Claims::decode(&auth) { Ok(claims) => Some(claims.claims), @@ -398,6 +393,7 @@ impl Perform<PostResponse> for Oper<EditPost> { 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) { |