about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-05-25 14:26:45 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-05-25 14:26:45 +0200
commitcdbdf7f98bb45439908cb23d0dfae228d59b3c1f (patch)
tree928b365880612f0cdf686df9794d6aedac57518f /app
parent2587fcdd27613e52d620e3c93bb089932be48db0 (diff)
Ignore multiple occurrences of a hashtag within a status (fixes #7585) (#7606)
Diffstat (limited to 'app')
-rw-r--r--app/lib/activitypub/activity/create.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index ab1d63cd4..010ed1bb5 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -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