From b0001966c61033dfd08cd50f7ecc716d79fc59ff Mon Sep 17 00:00:00 2001 From: David Roetzel Date: Fri, 20 Dec 2024 16:19:51 +0100 Subject: [PATCH] Only share public statuses. Only actually public, i.e. not "unlisted". One exception: Share an update if the update changed the visibility from "public" to something else. The fasp can act on this information then. --- app/models/concerns/status/fasp_concern.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/status/fasp_concern.rb b/app/models/concerns/status/fasp_concern.rb index bc0779e39c..82c6e8a9b6 100644 --- a/app/models/concerns/status/fasp_concern.rb +++ b/app/models/concerns/status/fasp_concern.rb @@ -13,20 +13,20 @@ module Status::FaspConcern private def announce_new_content_to_subscribed_fasp - return unless account_indexable? + return unless account_indexable? && public_visibility? store_uri unless uri # TODO: solve this more elegantly Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'new') end def announce_updated_content_to_subscribed_fasp - return unless account_indexable? + return unless account_indexable? && public_visibility_or_just_changed? Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'update') end def announce_deleted_content_to_subscribed_fasp - return unless account_indexable? + return unless account_indexable? && public_visibility? Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'delete') end @@ -42,4 +42,8 @@ module Status::FaspConcern end Fasp::AnnounceTrendWorker.perform_async(candidate_id, trend_source) if candidate_id end + + def public_visibility_or_just_changed? + public_visibility? || visibility_previously_was == 'public' + end end