Merge branch 'kb-draft-7.0' into kb_development
This commit is contained in:
commit
5b21964bda
8 changed files with 58 additions and 6 deletions
|
@ -44,7 +44,7 @@ class Api::V1::StatusesController < Api::BaseController
|
|||
|
||||
ancestors_results = @status.in_reply_to_id.nil? ? [] : @status.ancestors(ancestors_limit, current_account)
|
||||
descendants_results = @status.descendants(descendants_limit, current_account, descendants_depth_limit)
|
||||
references_results = @status.references
|
||||
references_results = @status.readable_references(current_account)
|
||||
loaded_ancestors = cache_collection(ancestors_results, Status)
|
||||
loaded_descendants = cache_collection(descendants_results, Status)
|
||||
loaded_references = cache_collection(references_results, Status)
|
||||
|
|
|
@ -18,6 +18,7 @@ module KmyblueCapabilitiesHelper
|
|||
:kmyblue_quote,
|
||||
:kmyblue_searchability_limited,
|
||||
:kmyblue_searchability_public_unlisted,
|
||||
:kmyblue_circle_history,
|
||||
]
|
||||
|
||||
capabilities << :profile_search unless Chewy.enabled?
|
||||
|
|
|
@ -11,6 +11,15 @@ module StatusThreadingConcern
|
|||
find_statuses_from_tree_path(descendant_ids(limit, depth), account, promote: true)
|
||||
end
|
||||
|
||||
def readable_references(account = nil)
|
||||
statuses = references.to_a
|
||||
account_ids = statuses.map(&:account_id).uniq
|
||||
domains = statuses.filter_map(&:account_domain).uniq
|
||||
relations = account&.relations_map(account_ids, domains) || {}
|
||||
statuses.reject! { |status| StatusFilter.new(status, account, relations).filtered? }
|
||||
statuses
|
||||
end
|
||||
|
||||
def self_replies(limit)
|
||||
account.statuses.where(in_reply_to_id: id, visibility: [:public, :unlisted, :public_unlisted, :login]).reorder(id: :asc).limit(limit)
|
||||
end
|
||||
|
|
|
@ -40,7 +40,7 @@ class NodeInfo::Serializer < ActiveModel::Serializer
|
|||
|
||||
def metadata
|
||||
{
|
||||
fedibird_capabilities: fedibird_capabilities,
|
||||
features: fedibird_capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue