Explorar el Código

Fix Pleroma mentions being fetched as preview cards (#9158)

master
ThibG hace 5 años
committed by Eugen Rochko
padre
commit
a03d506626
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. +3
    -5
      app/services/fetch_link_card_service.rb

+ 3
- 5
app/services/fetch_link_card_service.rb Ver fichero

@@ -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



Cargando…
Cancelar
Guardar