about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/instances/peers_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/api/v1/instances/peers_controller.rb b/app/controllers/api/v1/instances/peers_controller.rb
index a8891d126..93c4c45af 100644
--- a/app/controllers/api/v1/instances/peers_controller.rb
+++ b/app/controllers/api/v1/instances/peers_controller.rb
@@ -7,11 +7,16 @@ class Api::V1::Instances::PeersController < Api::BaseController
   respond_to :json
 
   def index
-    render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { Account.remote.domains }
+    render_cached_json('api:v1:instances:peers:index', expires_in: 1.day) { actively_federated_domains }
   end
 
   private
 
+  def actively_federated_domains
+    blocks = DomainBlock.suspend
+    Account.remote.where(suspended_at: nil).domains.reject { |domain| blocks.where('domain LIKE ?', "%.#{domain}").exists? }
+  end
+
   def require_enabled_api!
     head 404 unless Setting.peers_api_enabled
   end