about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-14 16:21:51 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-14 16:21:51 -0600
commit4f7e76a1308cc35f97f47a9f42c197aeca9ee2de (patch)
tree8030ac9944cbd39b7fb3bae2a089bf3d302ea90a /app
parent803d632ea1063068645d11fca99c0dc624fbb86d (diff)
split auto-trust instance actor setting into auto-trust & always trust
Diffstat (limited to 'app')
-rw-r--r--app/models/account.rb2
-rw-r--r--app/models/form/admin_settings.rb2
-rw-r--r--app/services/activitypub/process_account_service.rb2
-rw-r--r--app/views/admin/settings/edit.html.haml2
4 files changed, 6 insertions, 2 deletions
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