|
|
@ -81,12 +81,12 @@ module StatusThreadingConcern |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def find_statuses_from_tree_path(ids, account, promote: false) |
|
|
|
def find_statuses_from_tree_path(ids, account, promote: false) |
|
|
|
statuses = statuses_with_accounts(ids).to_a |
|
|
|
statuses = Status.with_accounts(ids).to_a |
|
|
|
account_ids = statuses.map(&:account_id).uniq |
|
|
|
account_ids = statuses.map(&:account_id).uniq |
|
|
|
domains = statuses.map(&:account_domain).compact.uniq |
|
|
|
domains = statuses.map(&:account_domain).compact.uniq |
|
|
|
relations = relations_map_for_account(account, account_ids, domains) |
|
|
|
relations = relations_map_for_account(account, account_ids, domains) |
|
|
|
|
|
|
|
|
|
|
|
statuses.reject! { |status| filter_from_context?(status, account, relations) } |
|
|
|
statuses.reject! { |status| StatusFilter.new(status, account, relations).filtered? } |
|
|
|
|
|
|
|
|
|
|
|
# Order ancestors/descendants by tree path |
|
|
|
# Order ancestors/descendants by tree path |
|
|
|
statuses.sort_by! { |status| ids.index(status.id) } |
|
|
|
statuses.sort_by! { |status| ids.index(status.id) } |
|
|
@ -125,12 +125,4 @@ module StatusThreadingConcern |
|
|
|
domain_blocking_by_domain: Account.domain_blocking_map_by_domain(domains, account.id), |
|
|
|
domain_blocking_by_domain: Account.domain_blocking_map_by_domain(domains, account.id), |
|
|
|
} |
|
|
|
} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def statuses_with_accounts(ids) |
|
|
|
|
|
|
|
Status.where(id: ids).includes(:account) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def filter_from_context?(status, account, relations) |
|
|
|
|
|
|
|
StatusFilter.new(status, account, relations).filtered? |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|