about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-10-24 18:51:27 -0500
committerDavid Yip <yipdw@member.fsf.org>2017-10-24 18:51:27 -0500
commitd03b48cea06ac87eecaf7eae96d175ab8ee621ca (patch)
treec74c22267765dad868ad11918b939cc3e0873dc9 /app
parent9226257a1b43727d61f78621ff7eaadbe37c8fda (diff)
Also filter notifications containing muted keywords.
Diffstat (limited to 'app')
-rw-r--r--app/lib/feed_manager.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index e0a257cd0..2ddfac336 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -177,7 +177,7 @@ class FeedManager
       should_filter ||= matcher =~ status.reblog.spoiler_text
     end
 
-    should_filter
+    !!should_filter
   end
 
   def filter_from_mentions?(status, receiver_id)
@@ -189,6 +189,7 @@ class FeedManager
 
     should_filter   = Block.where(account_id: receiver_id, target_account_id: check_for_blocks).any?                                     # Filter if it's from someone I blocked, in reply to someone I blocked, or mentioning someone I blocked
     should_filter ||= (status.account.silenced? && !Follow.where(account_id: receiver_id, target_account_id: status.account_id).exists?) # of if the account is silenced and I'm not following them
+    should_filter ||= keyword_filter?(status, Glitch::KeywordMute.matcher_for(receiver_id))                                              # or if the mention contains a muted keyword
 
     should_filter
   end