Skip to content

Commit

Permalink
Fix: ブーストされたばかりの投稿を編集しても相手のタイムラインに反映されない問題
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Oct 2, 2023
1 parent f5b6592 commit 952f516
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/lib/feed_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def filter?(timeline_type, status, receiver, stl_home = false) # rubocop:disable
# @param [Boolean] update
# @return [Boolean]
def push_to_home(account, status, update: false)
return false unless add_to_feed(:home, account.id, status, aggregate_reblogs: account.user&.aggregates_reblogs?)
return false unless add_to_feed(:home, account.id, status, aggregate_reblogs: account.user&.aggregates_reblogs?, update: update)

trim(:home, account.id)
PushUpdateWorker.perform_async(account.id, status.id, "timeline:#{account.id}", { 'update' => update }) if push_update_required?("timeline:#{account.id}")
Expand All @@ -83,15 +83,15 @@ def unpush_from_home(account, status, update: false)
# @param [Boolean] update
# @return [Boolean]
def push_to_list(list, status, update: false)
return false if filter_from_list?(status, list) || !add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?)
return false if filter_from_list?(status, list) || !add_to_feed(:list, list.id, status, aggregate_reblogs: list.account.user&.aggregates_reblogs?, update: update)

trim(:list, list.id)
PushUpdateWorker.perform_async(list.account_id, status.id, "timeline:list:#{list.id}", { 'update' => update }) if push_update_required?("timeline:list:#{list.id}")
true
end

def push_to_antenna(antenna, status, update: false)
return false unless add_to_feed(:antenna, antenna.id, status, aggregate_reblogs: antenna.account.user&.aggregates_reblogs?)
return false unless add_to_feed(:antenna, antenna.id, status, aggregate_reblogs: antenna.account.user&.aggregates_reblogs?, update: update)

trim(:antenna, antenna.id)
PushUpdateWorker.perform_async(antenna.account_id, status.id, "timeline:antenna:#{antenna.id}", { 'update' => update }) if push_update_required?("timeline:antenna:#{antenna.id}")
Expand Down Expand Up @@ -497,7 +497,9 @@ def filter_from_tags?(status, receiver_id, crutches)
# @param [Status] status
# @param [Boolean] aggregate_reblogs
# @return [Boolean]
def add_to_feed(timeline_type, account_id, status, aggregate_reblogs: true)
def add_to_feed(timeline_type, account_id, status, aggregate_reblogs: true, update: false)
return true if update

timeline_key = key(timeline_type, account_id)
reblog_key = key(timeline_type, account_id, 'reblogs')

Expand Down

0 comments on commit 952f516

Please sign in to comment.