rich media: use optimized Object.normalize()
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 00:22:57 +0000 (00:22 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 00:22:57 +0000 (00:22 +0000)
lib/pleroma/web/rich_media/helpers.ex

index 92c61ff511a603bb30625fcf632f52e97522b5b7..f97d1863c4505f524369a38df424404c3bc6c441 100644 (file)
@@ -23,7 +23,7 @@ defmodule Pleroma.Web.RichMedia.Helpers do
 
   def fetch_data_for_activity(%Activity{} = activity) do
     with true <- Pleroma.Config.get([:rich_media, :enabled]),
-         %Object{} = object <- Object.normalize(activity.data["object"]),
+         %Object{} = object <- Object.normalize(activity),
          {:ok, page_url} <- HTML.extract_first_external_url(object, object.data["content"]),
          :ok <- validate_page_url(page_url),
          {:ok, rich_media} <- Parser.parse(page_url) do