Call Post::publish_updated() only for local posts

This commit is contained in:
Kitaiti Makoto 2021-02-24 02:26:04 +09:00
parent ea1f4d48d5
commit 589c159eb9

View File

@ -15,7 +15,7 @@ use heck::KebabCase;
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use plume_common::{ use plume_common::{
activity_pub::{ activity_pub::{
inbox::{AsObject, FromId}, inbox::{AsActor, AsObject, FromId},
Hashtag, Id, IntoId, Licensed, Source, PUBLIC_VISIBILITY, Hashtag, Id, IntoId, Licensed, Source, PUBLIC_VISIBILITY,
}, },
utils::md_to_html, utils::md_to_html,
@ -94,8 +94,11 @@ impl Post {
let post = Self::get(conn, self.id)?; let post = Self::get(conn, self.id)?;
// TODO: Call publish_published() when newly published // TODO: Call publish_published() when newly published
if post.published { if post.published {
let blog = post.get_blog(conn);
if blog.is_ok() && blog.unwrap().is_local() {
self.publish_updated(); self.publish_updated();
} }
}
Ok(post) Ok(post)
} }