From 5959c60e4482945923b087833c4953102baf290e Mon Sep 17 00:00:00 2001
From: multiple creatures <dev@multiple-creature.party>
Date: Fri, 14 Feb 2020 06:03:33 -0600
Subject: automatically trust the instance actor when marking another account
 as known

---
 app/models/account.rb | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'app/models')

diff --git a/app/models/account.rb b/app/models/account.rb
index 90da8bd21..be46a743f 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -251,6 +251,13 @@ class Account < ApplicationRecord
 
   def mark_known!
     update!(known: true)
+
+    unless local? || !Setting.auto_mark_known || domain == username
+      _instance_actor = Account.find_remote(domain, domain)
+      return if _instance_actor.nil? || _instance_actor.known?
+
+      _instance_actor.mark_known!
+    end
   end
 
   def force_unlisted!
-- 
cgit