From 4f7e76a1308cc35f97f47a9f42c197aeca9ee2de Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 14 Feb 2020 16:21:51 -0600 Subject: split auto-trust instance actor setting into auto-trust & always trust --- app/models/account.rb | 2 +- app/models/form/admin_settings.rb | 2 ++ app/services/activitypub/process_account_service.rb | 2 +- app/views/admin/settings/edit.html.haml | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/account.rb b/app/models/account.rb index 68d23b299..ca298f5d8 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -252,7 +252,7 @@ class Account < ApplicationRecord def mark_known! update!(known: true) - unless local? || domain == username + unless local? || !Setting.auto_mark_instance_actors_known || domain == username _instance_actor = Account.find_remote(domain, domain) return if _instance_actor.nil? || _instance_actor.known? diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 03f6059dc..359271e5d 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -37,6 +37,7 @@ class Form::AdminSettings auto_reject_unknown auto_mark_known auto_mark_instance_actors_known + always_mark_instance_actors_known werewolf_status spam_check_enabled ).freeze @@ -57,6 +58,7 @@ class Form::AdminSettings auto_reject_unknown auto_mark_known auto_mark_instance_actors_known + always_mark_instance_actors_known werewolf_status spam_check_enabled ).freeze diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 6dd73b112..4067e474f 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -62,7 +62,7 @@ class ActivityPub::ProcessAccountService < BaseService @account.silenced_at = domain_block.created_at if auto_silence? @account.force_unlisted = true if auto_force_unlisted? @account.force_sensitive = true if auto_force_sensitive? - @account.known = @username == @domain ? Setting.auto_mark_instance_actors_known : (!Setting.auto_reject_unknown && Setting.auto_mark_known) + @account.known = @username == @domain ? Setting.always_mark_instance_actors_known : (!Setting.auto_reject_unknown && Setting.auto_mark_known) end def update_account diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml index fe1ba447a..2203c8275 100644 --- a/app/views/admin/settings/edit.html.haml +++ b/app/views/admin/settings/edit.html.haml @@ -48,6 +48,8 @@ = f.input :auto_mark_instance_actors_known, as: :boolean, wrapper: :with_label, label: t('admin.settings.auto_mark_instance_actors_known.title'), hint: t('admin.settings.auto_mark_instance_actors_known.desc_html') + = f.input :always_mark_instance_actors_known, as: :boolean, wrapper: :with_label, label: t('admin.settings.always_mark_instance_actors_known.title'), hint: t('admin.settings.always_mark_instance_actors_known.desc_html') + %hr.spacer/ .fields-group -- cgit