about summary refs log tree commit diff
path: root/app/services/fetch_link_card_service.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-10-30 20:10:09 +0100
committerGitHub <noreply@github.com>2018-10-30 20:10:09 +0100
commit08c0f8b67c7316b020c5623c69d02665146ebd57 (patch)
tree9411daf86f412a69c2536cfc302b484bd3ea16ae /app/services/fetch_link_card_service.rb
parent7e18e95716052d5566f2e31559cbe4a68268f493 (diff)
parent0d6b8f36aaee9c8c68c64ce4a63bcc66c6faf78d (diff)
Merge pull request #802 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/fetch_link_card_service.rb')
-rw-r--r--app/services/fetch_link_card_service.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb
index 462e5ee13..3e77579bb 100644
--- a/app/services/fetch_link_card_service.rb
+++ b/app/services/fetch_link_card_service.rb
@@ -17,8 +17,7 @@ class FetchLinkCardService < BaseService
 
     return if @url.nil? || @status.preview_cards.any?
 
-    @mentions = status.mentions
-    @url      = @url.to_s
+    @url = @url.to_s
 
     RedisLock.acquire(lock_options) do |lock|
       if lock.acquired?
@@ -84,9 +83,8 @@ class FetchLinkCardService < BaseService
   end
 
   def mention_link?(a)
-    return false if @mentions.nil?
-    @mentions.any? do |mention|
-      a['href'] == TagManager.instance.url_for(mention.target)
+    @status.mentions.any? do |mention|
+      a['href'] == TagManager.instance.url_for(mention.account)
     end
   end