about summary refs log tree commit diff
path: root/app/models/account.rb
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/account.rb
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/account.rb')
-rw-r--r--app/models/account.rb8
1 files changed, 8 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