From 2ffd357d9511a5de86ea24c1757fd970616a40e3 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 29 Mar 2021 01:38:28 +0900 Subject: [PATCH 1/2] Update Post.ap_url when published --- src/routes/posts.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 1aafe578..78854006 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -290,6 +290,13 @@ pub fn update( let newly_published = if !post.published && !form.draft { post.published = true; post.creation_date = Utc::now().naive_utc(); + // TODO: share code with Post::insert() + post.ap_url = plume_models::ap_url(&format!( + "{}/~/{}/{}/", + CONFIG.base_url, + post.get_blog(&conn).unwrap().fqn, + new_slug + )); true } else { false From 664a3ddeeac6b9faf9d9d1a2b548069612f2c01d Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Mon, 29 Mar 2021 02:26:30 +0900 Subject: [PATCH 2/2] Add changelog about update of ap_url --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d17ccb0..8784e303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Menu animation not opening on iOS (#876, #897) - Make actors subscribe to channel once (#913) - Upsert posts and media instead of trying to insert and fail (#912) +- Update post's ActivityPub id when published by update ## [[0.6.0]] - 2020-12-29