Revert "Add block from bot follow settings"
This reverts commit ff994d78fa
.
This commit is contained in:
parent
ff994d78fa
commit
cfa250421e
12 changed files with 13 additions and 208 deletions
|
@ -36,7 +36,7 @@ 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 = @account.locked? || current_user.account.silenced? ? {} : { following_map: { @account.id => { reblogs: follow.show_reblogs?, notify: follow.notify?, languages: follow.languages } }, requested_map: { @account.id => false } }
|
||||
|
||||
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships(**options)
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ class ActivityPub::Activity::Follow < ActivityPub::Activity
|
|||
|
||||
follow_request = FollowRequest.create!(account: @account, target_account: target_account, uri: @json['id'])
|
||||
|
||||
if target_account.locked? || @account.silenced? || block_straight_follow? || (@account.bot? && target_account.user&.setting_lock_follow_from_bot)
|
||||
if target_account.locked? || @account.silenced? || block_straight_follow?
|
||||
LocalNotificationWorker.perform_async(target_account.id, follow_request.id, 'FollowRequest', 'follow_request')
|
||||
else
|
||||
AuthorizeFollowService.new.call(@account, target_account)
|
||||
|
|
|
@ -30,9 +30,9 @@ class StatusReachFinder
|
|||
if @status.reblog?
|
||||
[]
|
||||
elsif @status.limited_visibility?
|
||||
expect_bot_query(Account.where(id: mentioned_account_ids).where.not(domain: banned_domains)).inboxes
|
||||
Account.where(id: mentioned_account_ids).where.not(domain: banned_domains).inboxes
|
||||
else
|
||||
expect_bot_query(Account.where(id: reached_account_ids).where.not(domain: banned_domains)).inboxes
|
||||
Account.where(id: reached_account_ids).where.not(domain: banned_domains).inboxes
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -40,9 +40,9 @@ class StatusReachFinder
|
|||
if @status.reblog?
|
||||
[]
|
||||
elsif @status.limited_visibility?
|
||||
expect_bot_query(Account.where(id: mentioned_account_ids).where(domain: banned_domains_for_misskey)).inboxes
|
||||
Account.where(id: mentioned_account_ids).where(domain: banned_domains_for_misskey).inboxes
|
||||
else
|
||||
expect_bot_query(Account.where(id: reached_account_ids).where(domain: banned_domains_for_misskey)).inboxes
|
||||
Account.where(id: reached_account_ids).where(domain: banned_domains_for_misskey).inboxes
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -90,25 +90,21 @@ class StatusReachFinder
|
|||
|
||||
def followers_inboxes
|
||||
if @status.in_reply_to_local_account? && distributable?
|
||||
scope = @status.account.followers.or(@status.thread.account.followers.not_domain_blocked_by_account(@status.account)).where.not(domain: banned_domains)
|
||||
expect_bot_query(scope).inboxes
|
||||
@status.account.followers.or(@status.thread.account.followers.not_domain_blocked_by_account(@status.account)).where.not(domain: banned_domains).inboxes
|
||||
elsif @status.direct_visibility? || @status.limited_visibility?
|
||||
[]
|
||||
else
|
||||
scope = @status.account.followers.where.not(domain: banned_domains)
|
||||
expect_bot_query(scope).inboxes
|
||||
@status.account.followers.where.not(domain: banned_domains).inboxes
|
||||
end
|
||||
end
|
||||
|
||||
def followers_inboxes_for_misskey
|
||||
if @status.in_reply_to_local_account? && distributable?
|
||||
scope = @status.account.followers.or(@status.thread.account.followers.not_domain_blocked_by_account(@status.account)).where(domain: banned_domains_for_misskey)
|
||||
expect_bot_query(scope).inboxes
|
||||
@status.account.followers.or(@status.thread.account.followers.not_domain_blocked_by_account(@status.account)).where(domain: banned_domains_for_misskey).inboxes
|
||||
elsif @status.direct_visibility? || @status.limited_visibility?
|
||||
[]
|
||||
else
|
||||
scope = @status.account.followers.where(domain: banned_domains_for_misskey)
|
||||
expect_bot_query(scope).inboxes
|
||||
@status.account.followers.where(domain: banned_domains_for_misskey).inboxes
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -167,12 +163,4 @@ class StatusReachFinder
|
|||
from_domain_block = DomainBlock.where(detect_invalid_subscription: true).pluck(:domain)
|
||||
(from_info + from_domain_block).uniq
|
||||
end
|
||||
|
||||
def expect_bot_query(scope)
|
||||
if @status.account.user&.setting_stop_deliver_to_bot
|
||||
scope.where('actor_type NOT IN (\'Application\', \'Service\') OR accounts.id IN (?)', (@status.mentioned_accounts.pluck(:id) + [@status.in_reply_to_account_id]).compact)
|
||||
else
|
||||
scope
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -235,14 +235,6 @@ module HasUserSettings
|
|||
settings['disallow_unlisted_public_searchability']
|
||||
end
|
||||
|
||||
def setting_lock_follow_from_bot
|
||||
settings['lock_follow_from_bot']
|
||||
end
|
||||
|
||||
def setting_stop_deliver_to_bot
|
||||
settings['stop_deliver_to_bot']
|
||||
end
|
||||
|
||||
def allows_report_emails?
|
||||
settings['notification_emails.report']
|
||||
end
|
||||
|
|
|
@ -40,8 +40,6 @@ class UserSettings
|
|||
setting :unsafe_limited_distribution, default: false
|
||||
setting :dtl_force_with_tag, default: :none, in: %w(full searchability none)
|
||||
setting :dtl_force_subscribable, default: false
|
||||
setting :lock_follow_from_bot, default: false
|
||||
setting :stop_deliver_to_bot, default: false
|
||||
|
||||
setting_inverse_alias :indexable, :noindex
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class FollowService < BaseService
|
|||
# and the feeds are being merged
|
||||
mark_home_feed_as_partial! if @source_account.not_following_anyone?
|
||||
|
||||
if (@target_account.locked? && !@options[:bypass_locked]) || @source_account.silenced? || @target_account.activitypub? || (@source_account.bot? && @target_account.user&.setting_lock_follow_from_bot)
|
||||
if (@target_account.locked? && !@options[:bypass_locked]) || @source_account.silenced? || @target_account.activitypub?
|
||||
request_follow!
|
||||
elsif @target_account.local?
|
||||
direct_follow!
|
||||
|
|
|
@ -11,12 +11,6 @@
|
|||
.fields-group
|
||||
= ff.input :aggregate_reblogs, wrapper: :with_label, recommended: true, label: I18n.t('simple_form.labels.defaults.setting_aggregate_reblogs'), hint: I18n.t('simple_form.hints.defaults.setting_aggregate_reblogs')
|
||||
|
||||
.fields-group
|
||||
= ff.input :lock_follow_from_bot, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_lock_follow_from_bot')
|
||||
|
||||
.fields-group
|
||||
= ff.input :stop_deliver_to_bot, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.defaults.setting_stop_deliver_to_bot')
|
||||
|
||||
%h4= t 'preferences.posting_defaults'
|
||||
|
||||
.fields-row
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue