Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

Commit

Permalink
Fix Pleroma mentions being fetched as preview cards (mastodon#9158)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and Gargron committed Oct 30, 2018
1 parent c1eec98 commit a03d506
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/services/fetch_link_card_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def call(status)

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?
Expand Down Expand Up @@ -84,9 +83,8 @@ def bad_url?(uri)
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

Expand Down

0 comments on commit a03d506

Please sign in to comment.