fix(nodeinfo): fix getting application actor information from NodeInfo response

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-12-19 09:52:32 +01:00
parent 707add36dd
commit dd775b6ae2
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -25,9 +25,10 @@ defmodule Mobilizon.Federation.NodeInfo do
defp extract_application_actor(body) do defp extract_application_actor(body) do
body body
|> Enum.find(%{rel: @application_uri, href: nil}, fn %{rel: rel, href: href} -> |> Map.get("links", [])
|> Enum.find(%{"rel" => @application_uri, "href" => nil}, fn %{"rel" => rel, "href" => href} ->
rel == @application_uri and is_binary(href) rel == @application_uri and is_binary(href)
end) end)
|> Map.get(:href) |> Map.get("href")
end end
end end