about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-10-20 10:49:54 -0400
committerGitHub <noreply@github.com>2017-10-20 10:49:54 -0400
commita7be86e875cb0eb38ca2140306f84267d819905c (patch)
treeac664ea3b7156e2f5faeb73b8fcefae5f81c611e /app/lib
parentb15dd0551431ab66a9c5027e24bafb202cf6e645 (diff)
hide mentions of muted accounts (in home col) (#190)
* hide mentions of muted accounts (in home col)

also cleans up some old crap

* add test
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/feed_manager.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index 39d3333da..ca15745cb 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -138,16 +138,11 @@ class FeedManager
   end
 
   def filter_from_home?(status, receiver_id)
-    # extremely violent filtering code BEGIN
-    #filter_string = 'e'
-    #reggie = Regexp.new(filter_string)
-    #return true if reggie === status.content || reggie === status.spoiler_text
-    # extremely violent filtering code END
-
     return false if receiver_id == status.account_id
     return true  if status.reply? && (status.in_reply_to_id.nil? || status.in_reply_to_account_id.nil?)
 
     check_for_mutes = [status.account_id]
+    check_for_mutes.concat(status.mentions.pluck(:account_id))
     check_for_mutes.concat([status.reblog.account_id]) if status.reblog?
 
     return true if Mute.where(account_id: receiver_id, target_account_id: check_for_mutes).any?