Unify the method of extracting tags (#3138)
This commit is contained in:
parent
d2e0edd721
commit
d22cec81fb
2 changed files with 27 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
class ProcessHashtagsService < BaseService
|
||||
def call(status, tags = [])
|
||||
tags = status.text.scan(Tag::HASHTAG_RE).map(&:first) if status.local?
|
||||
tags = Extractor.extract_hashtags(status.text) if status.local?
|
||||
|
||||
tags.map { |str| str.mb_chars.downcase }.uniq(&:to_s).each do |tag|
|
||||
status.tags << Tag.where(name: tag).first_or_initialize(name: tag)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue