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.
This commit is contained in:
David Roetzel 2024-12-20 16:19:51 +01:00
parent 0b80d39fdd
commit b0001966c6
No known key found for this signature in database

View file

@ -13,20 +13,20 @@ module Status::FaspConcern
private private
def announce_new_content_to_subscribed_fasp 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 store_uri unless uri # TODO: solve this more elegantly
Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'new') Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'new')
end end
def announce_updated_content_to_subscribed_fasp 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') Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'update')
end end
def announce_deleted_content_to_subscribed_fasp def announce_deleted_content_to_subscribed_fasp
return unless account_indexable? return unless account_indexable? && public_visibility?
Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'delete') Fasp::AnnounceContentLifecycleEventWorker.perform_async(uri, 'delete')
end end
@ -42,4 +42,8 @@ module Status::FaspConcern
end end
Fasp::AnnounceTrendWorker.perform_async(candidate_id, trend_source) if candidate_id Fasp::AnnounceTrendWorker.perform_async(candidate_id, trend_source) if candidate_id
end end
def public_visibility_or_just_changed?
public_visibility? || visibility_previously_was == 'public'
end
end end