Match keyword mute filter on hashtags. #208.

It is reasonable to expect someone to enter #foo to mute hashtag #foo.
However, tags are recorded on statuses without the preceding #.
To adjust for this, we build a separate tag matcher and use
Tag::HASHTAG_RE to extract a hashtag from the hashtag syntax.
This commit is contained in:
David Yip
2017-11-15 17:26:29 -06:00
parent 431503bae2
commit cb4ef24ac9
3 changed files with 69 additions and 32 deletions

View File

@@ -4,8 +4,8 @@ RSpec.describe Glitch::KeywordMute, type: :model do
let(:alice) { Fabricate(:account, username: 'alice').tap(&:save!) }
let(:bob) { Fabricate(:account, username: 'bob').tap(&:save!) }
describe '.matcher_for' do
let(:matcher) { Glitch::KeywordMute.matcher_for(alice) }
describe '.text_matcher_for' do
let(:matcher) { Glitch::KeywordMute.text_matcher_for(alice.id) }
describe 'with no mutes' do
before do