From 13de392fc5769114015bb6780dce41e803fa6946 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 15 Feb 2020 10:42:01 -0600 Subject: add admin option to toggle whether service/app accounts should be auto-trusted in graylist mode + give options better descriptions --- app/models/account.rb | 8 ++++++++ app/models/form/admin_settings.rb | 2 ++ 2 files changed, 10 insertions(+) (limited to 'app/models') 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 -- cgit