From 842a93243afba76e6e9be057b2dcf5454b38bf89 Mon Sep 17 00:00:00 2001 From: KMY Date: Wed, 11 Oct 2023 09:59:00 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=97=E3=81=AB?= =?UTF-8?q?=E8=AA=8D=E8=A8=BC=E6=83=85=E5=A0=B1=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/activitypub/activity/like.rb | 2 +- app/models/emoji_reaction.rb | 4 ++++ app/models/status.rb | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/lib/activitypub/activity/like.rb b/app/lib/activitypub/activity/like.rb index 1087a6c8b02d77..86aaba076dd317 100644 --- a/app/lib/activitypub/activity/like.rb +++ b/app/lib/activitypub/activity/like.rb @@ -78,7 +78,7 @@ def relay_for_emoji_reaction end def relay_friend_for_emoji_reaction - return unless @json['signature'].present? && @original_status.public_visibility? + return unless @json['signature'].present? && @original_status.distributable_friend? ActivityPub::DeliveryWorker.push_bulk(FriendDomain.distributables.pluck(:inbox_url)) do |inbox_url| [Oj.dump(@json), @original_status.account.id, inbox_url] diff --git a/app/models/emoji_reaction.rb b/app/models/emoji_reaction.rb index ce0a7dfb2edb4d..5d6d58513cc92d 100644 --- a/app/models/emoji_reaction.rb +++ b/app/models/emoji_reaction.rb @@ -43,6 +43,10 @@ def remote_custom_emoji? custom_emoji? && !custom_emoji.local? end + def sign? + status&.distributable_friend? + end + private def refresh_cache diff --git a/app/models/status.rb b/app/models/status.rb index 26baac1b680d0d..4b718cdc928ef5 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -591,6 +591,10 @@ def unlink_from_conversations! end end + def distributable_friend? + public_visibility? || public_unlisted_visibility? || (unlisted_visibility? && (public_searchability? || public_unlisted_searchability?)) + end + private def update_status_stat!(attrs)