about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-02-15 10:42:01 -0600
committermultiple creatures <dev@multiple-creature.party>2020-02-15 10:42:01 -0600
commit13de392fc5769114015bb6780dce41e803fa6946 (patch)
treebc85ee77a51a0cf324955a6cbde0e15d0e850503 /app/models
parentd1ea02408be8ecaa2b67ff8f219674639999ebba (diff)
add admin option to toggle whether service/app accounts should be auto-trusted in graylist mode + give options better descriptions
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb8
-rw-r--r--app/models/form/admin_settings.rb2
2 files changed, 10 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index ca298f5d8..a2fa60a83 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -474,6 +474,14 @@ class Account < ApplicationRecord
     target_account.following?(self) || ever_mentioned_by?(target_account)
   end
 
+  def service?
+    @_is_service ||= actor_type == "Application" || actor_type == "Service" || username == "relay" || username == domain
+  end
+
+  def can_be_marked_known?
+    !known && (!service || (service? && Setting.auto_mark_services_known)) && Setting.auto_mark_known
+  end
+
   class Field < ActiveModelSerializers::Model
     attributes :name, :value, :verified_at, :account, :errors
 
diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb
index f5006c3e3..00abb3906 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
+    auto_mark_services_known
     always_mark_instance_actors_known
     werewolf_status
     spam_check_enabled
@@ -62,6 +63,7 @@ class Form::AdminSettings
     auto_reject_unknown
     auto_mark_known
     auto_mark_instance_actors_known
+    auto_mark_services_known
     always_mark_instance_actors_known
     werewolf_status
     spam_check_enabled