diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-08-06 06:15:22 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2018-08-06 08:22:10 +0000 |
commit | b7ca7f282ac43fcbda63c822553497baa0009835 (patch) | |
tree | 835e3e53f31e84f35e63dbc3b9748894f247b5c9 | |
parent | 00e890264c10b21d780c0106d29e42c507df1cbb (diff) | |
download | pleroma-b7ca7f282ac43fcbda63c822553497baa0009835.tar.gz |
activitypub: refactor relay concerns into new relay module
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub_controller.ex | 3 | ||||
-rw-r--r-- | lib/pleroma/web/activity_pub/relay.ex | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex index a858b5df9..52b2a467e 100644 --- a/lib/pleroma/web/activity_pub/activity_pub_controller.ex +++ b/lib/pleroma/web/activity_pub/activity_pub_controller.ex @@ -3,6 +3,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do alias Pleroma.{User, Object} alias Pleroma.Web.ActivityPub.{ObjectView, UserView} alias Pleroma.Web.ActivityPub.ActivityPub + alias Pleroma.Web.ActivityPub.Relay alias Pleroma.Web.Federator require Logger @@ -108,7 +109,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do end def relay(conn, params) do - with %User{} = user <- User.get_or_create_instance_user(), + with %User{} = user <- Relay.get_actor(), {:ok, user} <- Pleroma.Web.WebFinger.ensure_keys_present(user) do conn |> put_resp_header("content-type", "application/activity+json") diff --git a/lib/pleroma/web/activity_pub/relay.ex b/lib/pleroma/web/activity_pub/relay.ex new file mode 100644 index 000000000..736d0e406 --- /dev/null +++ b/lib/pleroma/web/activity_pub/relay.ex @@ -0,0 +1,7 @@ +defmodule Pleroma.Web.ActivityPub.Relay do + alias Pleroma.User + + def get_actor do + User.get_or_create_instance_user() + end +end |