diff options
author | Felix Ableitner <me@nutomic.com> | 2020-05-30 15:38:01 +0200 |
---|---|---|
committer | Felix Ableitner <me@nutomic.com> | 2020-05-30 15:38:01 +0200 |
commit | 52206998aaff0a32e97c250cadd537c11699398f (patch) | |
tree | 70d58130d24905ac9846080dcf3460a1700063a6 /server/src/api/post.rs | |
parent | d6e21192772a5631968fe5ddb51049287c34eba7 (diff) |
more fixes
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r-- | server/src/api/post.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/server/src/api/post.rs b/server/src/api/post.rs index aee60732..9bbde791 100644 --- a/server/src/api/post.rs +++ b/server/src/api/post.rs @@ -34,9 +34,6 @@ use diesel::{ use failure::Error; use serde::{Deserialize, Serialize}; use std::str::FromStr; -use crate::apub::get_apub_protocol_string; -use crate::db::community::Community; -use url::Url; #[derive(Serialize, Deserialize, Debug)] pub struct CreatePost { @@ -193,17 +190,7 @@ impl Perform for Oper<CreatePost> { } }; - // TODO: we should be able to remove Post::update_ap_id with this - let community = Url::parse(&Community::read(&conn, data.community_id)?.actor_id)?; - let apub_id = - format!( - "{}://{}/{}/{}", - get_apub_protocol_string(), - community.domain().ok_or(format_err!("community has invalid domain"))?, - "post", - inserted_post.id - ); - let updated_post = match Post::update_ap_id(&conn, inserted_post.id, &apub_id) { + let updated_post = match Post::update_ap_id(&conn, inserted_post.id) { Ok(post) => post, Err(_e) => return Err(APIError::err("couldnt_create_post").into()), }; |