1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2025-04-01 13:52:21 +02:00

Do not notify in case of by following group actor

This commit is contained in:
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

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