Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `package.json`: Not a real conflict, upstream dependency updated textually too close to a glitch-soc-only dependency. Updated the upstream dependency.
This commit is contained in:
@@ -132,7 +132,7 @@ class FeedManager
|
||||
def merge_into_home(from_account, into_account)
|
||||
timeline_key = key(:home, into_account.id)
|
||||
aggregate = into_account.user&.aggregates_reblogs?
|
||||
query = from_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, reblog: :account).limit(FeedManager::MAX_ITEMS / 4)
|
||||
query = from_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, :media_attachments, reblog: :account).limit(FeedManager::MAX_ITEMS / 4)
|
||||
|
||||
if redis.zcard(timeline_key) >= FeedManager::MAX_ITEMS / 4
|
||||
oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true).first.last.to_i
|
||||
@@ -158,7 +158,7 @@ class FeedManager
|
||||
def merge_into_list(from_account, list)
|
||||
timeline_key = key(:list, list.id)
|
||||
aggregate = list.account.user&.aggregates_reblogs?
|
||||
query = from_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, reblog: :account).limit(FeedManager::MAX_ITEMS / 4)
|
||||
query = from_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, :media_attachments, reblog: :account).limit(FeedManager::MAX_ITEMS / 4)
|
||||
|
||||
if redis.zcard(timeline_key) >= FeedManager::MAX_ITEMS / 4
|
||||
oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true).first.last.to_i
|
||||
@@ -182,10 +182,10 @@ class FeedManager
|
||||
# @param [Account] into_account
|
||||
# @return [void]
|
||||
def unmerge_from_home(from_account, into_account)
|
||||
timeline_key = key(:home, into_account.id)
|
||||
oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true)&.first&.last&.to_i || 0
|
||||
timeline_key = key(:home, into_account.id)
|
||||
timeline_status_ids = redis.zrange(timeline_key, 0, -1)
|
||||
|
||||
from_account.statuses.select('id, reblog_of_id').where('id > ?', oldest_home_score).reorder(nil).find_each do |status|
|
||||
from_account.statuses.select('id, reblog_of_id').where(id: timeline_status_ids).reorder(nil).find_each do |status|
|
||||
remove_from_feed(:home, into_account.id, status, into_account.user&.aggregates_reblogs?)
|
||||
end
|
||||
end
|
||||
@@ -195,10 +195,10 @@ class FeedManager
|
||||
# @param [List] list
|
||||
# @return [void]
|
||||
def unmerge_from_list(from_account, list)
|
||||
timeline_key = key(:list, list.id)
|
||||
oldest_list_score = redis.zrange(timeline_key, 0, 0, with_scores: true)&.first&.last&.to_i || 0
|
||||
timeline_key = key(:list, list.id)
|
||||
timeline_status_ids = redis.zrange(timeline_key, 0, -1)
|
||||
|
||||
from_account.statuses.select('id, reblog_of_id').where('id > ?', oldest_list_score).reorder(nil).find_each do |status|
|
||||
from_account.statuses.select('id, reblog_of_id').where(id: timeline_status_ids).reorder(nil).find_each do |status|
|
||||
remove_from_feed(:list, list.id, status, list.account.user&.aggregates_reblogs?)
|
||||
end
|
||||
end
|
||||
@@ -276,7 +276,7 @@ class FeedManager
|
||||
next if last_status_score < oldest_home_score
|
||||
end
|
||||
|
||||
statuses = target_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, reblog: :account).limit(limit)
|
||||
statuses = target_account.statuses.where(visibility: [:public, :unlisted, :private]).includes(:preloadable_poll, :media_attachments, reblog: :account).limit(limit)
|
||||
crutches = build_crutches(account.id, statuses)
|
||||
|
||||
statuses.each do |status|
|
||||
|
Reference in New Issue
Block a user