diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/services/process_hashtags_service.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/services/process_hashtags_service.rb b/app/services/process_hashtags_service.rb index 4257d9231..7f51d1fb8 100644 --- a/app/services/process_hashtags_service.rb +++ b/app/services/process_hashtags_service.rb @@ -6,12 +6,15 @@ class ProcessHashtagsService < BaseService records = [] tags.map { |str| str.mb_chars.downcase }.uniq(&:to_s).each do |name| + name = name.gsub(/::+/, ':') component_indices = name.size.times.select {|i| name[i] == ':'} component_indices << name.size - 1 - component_indices.each do |i| - frag = name[0..i] + component_indices.take(6).each_with_index do |i, nest| + frag = (nest != 5) ? name[0..i] : name tag = Tag.where(name: frag).first_or_create(name: frag) + p frag + status.tags << tag next if tag.local || tag.private |