diff options
author | ThibG <thib@sitedethib.com> | 2020-08-30 18:34:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 18:34:51 +0200 |
commit | f715e8b51612820a18fa307e4465eb0c1a088f86 (patch) | |
tree | 8137b48a716e05424ca544210d86e91818085ba7 /app/services | |
parent | 30632adf9eda6d83a9b4269f23f11ced5e09cd93 (diff) | |
parent | a68ec50e4e38898e88a7dcc33bd0032adc946dda (diff) |
Merge pull request #1411 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/fan_out_on_write_service.rb | 10 | ||||
-rw-r--r-- | app/services/hashtag_query_service.rb | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index dd9c1264d..5f3feeed9 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -8,8 +8,6 @@ class FanOutOnWriteService < BaseService deliver_to_self(status) if status.account.local? - render_anonymous_payload(status) - if status.direct_visibility? deliver_to_mentioned_followers(status) deliver_to_direct_timelines(status) @@ -24,6 +22,8 @@ class FanOutOnWriteService < BaseService return if status.account.silenced? || !status.public_visibility? return if status.reblog? && !Setting.show_reblogs_in_public_timelines + render_anonymous_payload(status) + deliver_to_hashtags(status) return if status.reply? && status.in_reply_to_account_id != status.account_id && !Setting.show_replies_in_public_timelines @@ -63,8 +63,10 @@ class FanOutOnWriteService < BaseService def deliver_to_mentioned_followers(status) Rails.logger.debug "Delivering status #{status.id} to limited followers" - FeedInsertWorker.push_bulk(status.mentions.includes(:account).map(&:account).select { |mentioned_account| mentioned_account.local? && mentioned_account.following?(status.account) }) do |follower| - [status.id, follower.id, :home] + status.mentions.joins(:account).merge(status.account.followers_for_local_distribution).select(:id).reorder(nil).find_in_batches do |followers| + FeedInsertWorker.push_bulk(followers) do |follower| + [status.id, follower.id, :home] + end end end diff --git a/app/services/hashtag_query_service.rb b/app/services/hashtag_query_service.rb index 196de0639..0bdf60221 100644 --- a/app/services/hashtag_query_service.rb +++ b/app/services/hashtag_query_service.rb @@ -8,7 +8,7 @@ class HashtagQueryService < BaseService all = tags_for(params[:all]) none = tags_for(params[:none]) - Status.distinct + Status.group(:id) .as_tag_timeline(tags, account, local) .tagged_with_all(all) .tagged_with_none(none) |