mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
rich media: helpers: only crawl Create activities
This commit is contained in:
parent
9a06d9f6e8
commit
c62220c500
1 changed files with 3 additions and 1 deletions
|
@ -21,7 +21,7 @@ defmodule Pleroma.Web.RichMedia.Helpers do
|
|||
defp validate_page_url(%URI{}), do: :ok
|
||||
defp validate_page_url(_), do: :error
|
||||
|
||||
def fetch_data_for_activity(%Activity{} = activity) do
|
||||
def fetch_data_for_activity(%Activity{data: %{"type" => "Create"}} = activity) do
|
||||
with true <- Pleroma.Config.get([:rich_media, :enabled]),
|
||||
%Object{} = object <- Object.normalize(activity),
|
||||
{:ok, page_url} <- HTML.extract_first_external_url(object, object.data["content"]),
|
||||
|
@ -32,4 +32,6 @@ defmodule Pleroma.Web.RichMedia.Helpers do
|
|||
_ -> %{}
|
||||
end
|
||||
end
|
||||
|
||||
def fetch_data_for_activity(_), do: %{}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue