X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Factivity_pub.ex;h=8e55df0d8cac2fc955b2394e197be133167ffe89;hb=a079ec3a3cdfd42d2cbd51c7698c2c87828e5778;hp=521c8b8520c2aac8f11f5a8fa6d80519a257f617;hpb=2144ce5188901c59cd72a0b5620862b23b47544e;p=akkoma diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 521c8b852..8e55df0d8 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1531,6 +1531,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do defp normalize_image(urls) when is_list(urls), do: urls |> List.first() |> normalize_image() defp normalize_image(_), do: nil + defp normalize_also_known_as(aka) when is_list(aka), do: aka + defp normalize_also_known_as(aka) when is_binary(aka), do: [aka] + defp normalize_also_known_as(nil), do: [] + defp object_to_user_data(data, additional) do fields = data @@ -1576,6 +1580,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do also_known_as = data |> Map.get("alsoKnownAs", []) + |> normalize_also_known_as() |> Enum.filter(fn url -> case URI.parse(url) do %URI{scheme: "http"} -> true @@ -1711,7 +1716,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do {:ok, maybe_update_follow_information(data)} else # If this has been deleted, only log a debug and not an error - {:error, {"Object has been deleted" = e, _, _}} -> + {:error, {"Object has been deleted", _, _} = e} -> Logger.debug("Could not decode user at fetch #{ap_id}, #{inspect(e)}") {:error, e}