From 446aad4ce2cb7afd0ba8e4b508e4dcba57eac790 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 11 Feb 2017 15:41:39 +0100 Subject: Make PuSH only distribute to subscriptions that match follower domains Allow PuSH to distribute private toots with that condition --- app/models/account.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/account.rb') 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 -- cgit