Fix hiding emoji reactions from anonymous

This commit is contained in:
KMY 2023-09-13 10:22:44 +09:00
parent ac33bc86fe
commit d450549d14
4 changed files with 9 additions and 1 deletions

View file

@ -15,6 +15,10 @@ class Api::V1::Statuses::EmojiReactionedByAccountsController < Api::BaseControll
private
def load_accounts
return [] unless Setting.enable_emoji_reaction
return [] if current_account.nil? && @status.account.emoji_reaction_policy != :allow
return [] if current_account.present? && !@status.account.show_emoji_reaction?(current_account)
scope = default_accounts
scope = scope.where.not(account_id: current_account.excluded_from_timeline_account_ids) unless current_account.nil?
scope.merge(paginated_emoji_reactions).to_a