Do not notify in case of by following group actor

pull/12071/head
noellabo 2019-10-04 03:15:44 +09:00
parent e971bc9695
commit 7fdff65f31
No known key found for this signature in database
GPG Key ID: 83C44358FCC835E1
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class ActivityPub::Activity
def distribute(status)
crawl_links(status)
notify_about_reblog(status) if reblog_of_local_account?(status)
notify_about_reblog(status) if reblog_of_local_account?(status) && !reblog_by_following_group_account?(status)
notify_about_mentions(status)
# Only continue if the status is supposed to have arrived in real-time.
@ -105,6 +105,10 @@ class ActivityPub::Activity
status.reblog? && status.reblog.account.local?
end
def reblog_by_following_group_account?(status)
status.reblog? && status.account.group? && status.reblog.account.following?(status.account)
end
def notify_about_reblog(status)
NotifyService.new.call(status.reblog.account, status)
end