about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/concerns/account_finder_concern.rb4
-rw-r--r--app/models/relay.rb2
-rw-r--r--app/services/report_service.rb2
3 files changed, 6 insertions, 2 deletions
diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account_finder_concern.rb
index 6b7237e89..7e3bbde09 100644
--- a/app/models/concerns/account_finder_concern.rb
+++ b/app/models/concerns/account_finder_concern.rb
@@ -12,6 +12,10 @@ module AccountFinderConcern
       find_remote(username, domain) || raise(ActiveRecord::RecordNotFound)
     end
 
+    def representative
+      find_local(Setting.site_contact_username.gsub(/\A@/, '')) || Account.local.find_by(suspended: false)
+    end
+
     def find_local(username)
       find_remote(username, nil)
     end
diff --git a/app/models/relay.rb b/app/models/relay.rb
index 75cb060b2..7478c110d 100644
--- a/app/models/relay.rb
+++ b/app/models/relay.rb
@@ -68,7 +68,7 @@ class Relay < ApplicationRecord
   end
 
   def some_local_account
-    @some_local_account ||= Account.local.find_by(suspended: false)
+    @some_local_account ||= Account.representative
   end
 
   def ensure_disabled
diff --git a/app/services/report_service.rb b/app/services/report_service.rb
index 057d05ab9..1bcc1c0d5 100644
--- a/app/services/report_service.rb
+++ b/app/services/report_service.rb
@@ -52,6 +52,6 @@ class ReportService < BaseService
   end
 
   def some_local_account
-    @some_local_account ||= Account.local.where(suspended: false).first
+    @some_local_account ||= Account.representative
   end
 end