1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-11-24 23:26:31 +09:00

Ignore multiple occurrences of a hashtag within a status (fixes #7585) (#7606)

This commit is contained in:
ThibG 2018-05-25 14:26:45 +02:00 committed by Eugen Rochko
parent 2587fcdd27
commit cdbdf7f98b

View File

@ -80,7 +80,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
hashtag = tag['name'].gsub(/\A#/, '').mb_chars.downcase
hashtag = Tag.where(name: hashtag).first_or_initialize(name: hashtag)
status.tags << hashtag
status.tags << hashtag unless status.tags.include?(hashtag)
rescue ActiveRecord::RecordInvalid
nil
end