Refactor Webfinger module, use XRD host-meta to find webfinger endpoint
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -654,7 +654,7 @@ defmodule Mobilizon.Federation.ActivityPub do
|
||||
@spec make_actor_from_nickname(String.t()) :: {:ok, %Actor{}} | {:error, any()}
|
||||
def make_actor_from_nickname(nickname) do
|
||||
case WebFinger.finger(nickname) do
|
||||
{:ok, %{"url" => url}} when not is_nil(url) ->
|
||||
{:ok, url} when is_binary(url) ->
|
||||
make_actor_from_url(url)
|
||||
|
||||
_e ->
|
||||
|
||||
@@ -159,7 +159,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do
|
||||
@spec finger_actor(String.t()) :: {:ok, String.t()} | {:error, String.t()}
|
||||
defp finger_actor(nickname) do
|
||||
case WebFinger.finger(nickname) do
|
||||
{:ok, %{"url" => url}} when not is_nil(url) ->
|
||||
{:ok, url} when is_binary(url) ->
|
||||
{:ok, url}
|
||||
|
||||
_e ->
|
||||
|
||||
Reference in New Issue
Block a user