mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-25 01:12:30 +00:00
Handle actor or object being AP Public string
Mastodon uses "https://www.w3.org/ns/activitystreams#Public" as object when sending a `Follow` activity to a relay Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
89b751e124
commit
822a522579
1 changed files with 9 additions and 1 deletions
|
@ -118,7 +118,15 @@ defmodule Mobilizon.Service.ActivityPub do
|
||||||
Getting an actor from url, eventually creating it
|
Getting an actor from url, eventually creating it
|
||||||
"""
|
"""
|
||||||
@spec get_or_fetch_actor_by_url(String.t(), boolean) :: {:ok, Actor.t()} | {:error, String.t()}
|
@spec get_or_fetch_actor_by_url(String.t(), boolean) :: {:ok, Actor.t()} | {:error, String.t()}
|
||||||
def get_or_fetch_actor_by_url(url, preload \\ false) do
|
def get_or_fetch_actor_by_url(url, preload \\ false)
|
||||||
|
|
||||||
|
def get_or_fetch_actor_by_url("https://www.w3.org/ns/activitystreams#Public", _preload) do
|
||||||
|
with %Actor{url: url} <- Relay.get_actor() do
|
||||||
|
get_or_fetch_actor_by_url(url)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_or_fetch_actor_by_url(url, preload) do
|
||||||
case Actors.get_actor_by_url(url, preload) do
|
case Actors.get_actor_by_url(url, preload) do
|
||||||
{:ok, %Actor{} = actor} ->
|
{:ok, %Actor{} = actor} ->
|
||||||
{:ok, actor}
|
{:ok, actor}
|
||||||
|
|
Loading…
Reference in a new issue