about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-11 15:41:39 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-11 15:41:39 +0100
commit446aad4ce2cb7afd0ba8e4b508e4dcba57eac790 (patch)
tree7ba827f801bea1556231d275a6a8a35471f8a954 /app/models
parentdc851c922ee1c244146baf1415a7bce4a25cccef (diff)
Make PuSH only distribute to subscriptions that match follower domains
Allow PuSH to distribute private toots with that condition
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index c2a41c4c6..ed5c46197 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -95,6 +95,10 @@ class Account < ApplicationRecord
     follow_requests.where(target_account: other_account).exists?
   end
 
+  def followers_domains
+    followers.reorder('').select('DISTINCT accounts.domain').map(&:domain)
+  end
+
   def local?
     domain.nil?
   end