about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-12 22:33:12 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:17 -0500
commite76a34ee42763fbf0d0252e54002ebe5fcb4b92c (patch)
treec1a968df4c99e7b67dce31e093cc0f4c821e6ff4 /app/services
parent57b3aa056b792cff4b1c9294323f9c07528a82e1 (diff)
[Moderation] Limit scope of admin-level silences to timelines, search, and accounts not following or followed by the user
Diffstat (limited to 'app/services')
-rw-r--r--app/services/notify_service.rb7
-rw-r--r--app/services/search_service.rb2
2 files changed, 7 insertions, 2 deletions
diff --git a/app/services/notify_service.rb b/app/services/notify_service.rb
index 9364a6ae8..5f12a6b97 100644
--- a/app/services/notify_service.rb
+++ b/app/services/notify_service.rb
@@ -47,6 +47,11 @@ class NotifyService < BaseService
     @following_sender = @recipient.following?(@notification.from_account) || @recipient.requested?(@notification.from_account)
   end
 
+  def following_recipient?
+    return @following_recipient if defined?(@following_recipient)
+    @following_recipient = @notification.from_account.following?(@recipient)
+  end
+
   def optional_non_follower?
     @recipient.user.settings.interactions['must_be_follower']  && !@notification.from_account.following?(@recipient)
   end
@@ -79,7 +84,7 @@ class NotifyService < BaseService
   end
 
   def hellbanned?
-    @notification.from_account.silenced? && !following_sender?
+    @notification.from_account.silenced? && !(following_sender? || following_recipient?)
   end
 
   def from_self?
diff --git a/app/services/search_service.rb b/app/services/search_service.rb
index 19500a8d4..819ce2c16 100644
--- a/app/services/search_service.rb
+++ b/app/services/search_service.rb
@@ -53,7 +53,7 @@ class SearchService < BaseService
     account_domains     = results.map(&:account_domain)
     preloaded_relations = relations_map_for_account(@account, account_ids, account_domains)
 
-    results.reject { |status| StatusFilter.new(status, @account, preloaded_relations).filtered? }
+    results.reject { |status| StatusFilter.new(status, @account, true, preloaded_relations).filtered? }
   rescue Faraday::ConnectionFailed, Parslet::ParseFailed
     []
   end