Skip to content

Commit

Permalink
自分の投稿をリストに挿入するように
Browse files Browse the repository at this point in the history
  • Loading branch information
kyori19 committed Nov 16, 2018
1 parent 142f416 commit 27146c7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/services/fan_out_on_write_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def call(status)
deliver_to_self(status) if status.account.local?
deliver_to_followers(status)
deliver_to_lists(status)
deliver_to_self_lists(status)
end

return if status.account.silenced? || !status.public_visibility? || status.reblog?
Expand Down Expand Up @@ -55,6 +56,16 @@ def deliver_to_lists(status)
end
end

def deliver_to_self_lists(status)
Rails.logger.debug "Delivering status #{status.id} to own lists"

List.where(account_id: status.account.id).select(:id).reorder(nil).find_in_batches do |lists|
FeedInsertWorker.push_bulk(lists) do |list|
[status.id, list.id, :list]
end
end
end

def deliver_to_mentioned_followers(status)
Rails.logger.debug "Delivering status #{status.id} to limited followers"

Expand Down

0 comments on commit 27146c7

Please sign in to comment.