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

Conflicts:
- app/controllers/about_controller.rb
- app/controllers/tags_controller.rb
- app/views/about/show.html.haml
- spec/views/about/show.html.haml_spec.rb
This commit is contained in:
Thibaut Girka
2019-03-13 15:16:02 +01:00
97 changed files with 642 additions and 1688 deletions

View File

@ -28,13 +28,16 @@ class ActivityPub::DistributePollUpdateWorker
def inboxes
return @inboxes if defined?(@inboxes)
target_accounts = @status.mentions.map(&:account).reject(&:local?)
target_accounts += @status.reblogs.map(&:account).reject(&:local?)
target_accounts += @status.poll.votes.map(&:account).reject(&:local?)
target_accounts.uniq!(&:id)
@inboxes = target_accounts.select(&:activitypub?).pluck(&:inbox_url)
@inboxes += @account.followers.inboxes unless @status.direct_visibility?
@inboxes = [@status.mentions, @status.reblogs, @status.poll.votes].flat_map do |relation|
relation.includes(:account).map do |record|
record.account.preferred_inbox_url if !record.account.local? && record.account.activitypub?
end
end
@inboxes.concat(@account.followers.inboxes) unless @status.direct_visibility?
@inboxes.uniq!
@inboxes.compact!
@inboxes
end