about summary refs log tree commit diff
path: root/app/models/glitch
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-10-21 15:44:47 -0500
committerDavid Yip <yipdw@member.fsf.org>2017-10-21 15:44:47 -0500
commitad86c86fa8e0d577b1a6c7411367420e6beea4ea (patch)
treee0be0cb0ca1e454b8e3cd73d6471163018e6efc0 /app/models/glitch
parent670e6a33f8eeca628707dc020e02ce32502d74a4 (diff)
Apply keyword mutes to reblogs.
Diffstat (limited to 'app/models/glitch')
-rw-r--r--app/models/glitch/keyword_mute.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/glitch/keyword_mute.rb b/app/models/glitch/keyword_mute.rb
index 3b0b47f52..823e252d3 100644
--- a/app/models/glitch/keyword_mute.rb
+++ b/app/models/glitch/keyword_mute.rb
@@ -45,5 +45,9 @@ class Glitch::KeywordMute < ApplicationRecord
     def =~(str)
       regex ? regex =~ str : false
     end
+
+    def matches?(str)
+      !!(regex =~ str)
+    end
   end
 end