Merge remote-tracking branch 'parent/main' into upstream-20240403

This commit is contained in:
KMY 2024-04-03 12:12:09 +09:00
commit 479c4fecc1
63 changed files with 831 additions and 391 deletions

View file

@ -38,7 +38,12 @@ class Api::V1::AccountsController < Api::BaseController
def follow
follow = FollowService.new.call(current_user.account, @account, reblogs: params.key?(:reblogs) ? truthy_param?(:reblogs) : nil, notify: params.key?(:notify) ? truthy_param?(:notify) : nil, languages: params.key?(:languages) ? params[:languages] : nil, with_rate_limit: true)
options = @account.locked? || current_user.account.silenced? || (current_user.account.bot? && @account.user&.setting_lock_follow_from_bot) ? {} : { following_map: { @account.id => { reblogs: follow.show_reblogs?, notify: follow.notify?, languages: follow.languages } }, requested_map: { @account.id => false } }
options = if @account.locked? || current_user.account.silenced? || (current_user.account.bot? && @account.user&.setting_lock_follow_from_bot)
{}
else
{ following_map: { @account.id => { reblogs: follow.show_reblogs?, notify: follow.notify?, languages: follow.languages } },
requested_map: { @account.id => false } }
end
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships(**options)
end