Refactoring of Actors context

This commit is contained in:
miffigriffy
2019-09-11 03:16:37 +02:00
parent 60707b8f8d
commit e4a446003d
17 changed files with 671 additions and 763 deletions

View File

@@ -551,7 +551,7 @@ defmodule Mobilizon.Service.ActivityPub do
followers =
if actor.followers_url in activity.recipients do
Actors.get_full_external_followers(actor)
Actors.list_external_followers_for_actor(actor)
else
[]
end

View File

@@ -17,7 +17,7 @@ defmodule Mobilizon.Service.ActivityPub.Relay do
def get_actor do
with {:ok, %Actor{} = actor} <-
Actors.get_or_create_service_actor_by_url("#{MobilizonWeb.Endpoint.url()}/relay") do
Actors.get_or_create_actor_by_url("#{MobilizonWeb.Endpoint.url()}/relay") do
actor
end
end

View File

@@ -642,7 +642,7 @@ defmodule Mobilizon.Service.ActivityPub.Transmogrifier do
defp get_follow(follow_object) do
with follow_object_id when not is_nil(follow_object_id) <- Utils.get_url(follow_object),
{:not_found, %Follower{} = follow} <-
{:not_found, Actors.get_follow_by_url(follow_object_id)} do
{:not_found, Actors.get_follower_by_url(follow_object_id)} do
{:ok, follow}
else
{:not_found, _err} ->