From 589c159eb98b45c4d54693f17f266cf4a234dfc2 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Wed, 24 Feb 2021 02:26:04 +0900 Subject: [PATCH] Call Post::publish_updated() only for local posts --- plume-models/src/posts.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plume-models/src/posts.rs b/plume-models/src/posts.rs index f34d6cd0..bace3945 100644 --- a/plume-models/src/posts.rs +++ b/plume-models/src/posts.rs @@ -15,7 +15,7 @@ use heck::KebabCase; use once_cell::sync::Lazy; use plume_common::{ activity_pub::{ - inbox::{AsObject, FromId}, + inbox::{AsActor, AsObject, FromId}, Hashtag, Id, IntoId, Licensed, Source, PUBLIC_VISIBILITY, }, utils::md_to_html, @@ -94,7 +94,10 @@ impl Post { let post = Self::get(conn, self.id)?; // TODO: Call publish_published() when newly published if post.published { - self.publish_updated(); + let blog = post.get_blog(conn); + if blog.is_ok() && blog.unwrap().is_local() { + self.publish_updated(); + } } Ok(post) }