Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/controllers/statuses_controller.rb
  minor conflict because of glitch-soc's theming system
- app/controllers/stream_entries_controller.rb
  minor conflict because of glitch-soc's theming system
This commit is contained in:
Thibaut Girka
2019-05-10 17:09:12 +02:00
40 changed files with 669 additions and 130 deletions
+18 -2
View File
@@ -65,7 +65,14 @@ class ActivityPub::TagManager
when 'unlisted', 'private'
[account_followers_url(status.account)]
when 'direct', 'limited'
status.active_mentions.map { |mention| uri_for(mention.account) }
if status.account.silenced?
# Only notify followers if the account is locally silenced
account_ids = status.active_mentions.pluck(:account_id)
to = status.account.followers.where(id: account_ids).map { |account| uri_for(account) }
to.concat(FollowRequest.where(target_account_id: status.account_id, account_id: account_ids).map { |request| uri_for(request.account) })
else
status.active_mentions.map { |mention| uri_for(mention.account) }
end
end
end
@@ -86,7 +93,16 @@ class ActivityPub::TagManager
cc << COLLECTIONS[:public]
end
cc.concat(status.active_mentions.map { |mention| uri_for(mention.account) }) unless status.direct_visibility? || status.limited_visibility?
unless status.direct_visibility? || status.limited_visibility?
if status.account.silenced?
# Only notify followers if the account is locally silenced
account_ids = status.active_mentions.pluck(:account_id)
cc.concat(status.account.followers.where(id: account_ids).map { |account| uri_for(account) })
cc.concat(FollowRequest.where(target_account_id: status.account_id, account_id: account_ids).map { |request| uri_for(request.account) })
else
cc.concat(status.active_mentions.map { |mention| uri_for(mention.account) })
end
end
cc
end