aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/activity_pub/utils.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/activity_pub/utils.ex')
-rw-r--r--lib/pleroma/web/activity_pub/utils.ex13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex
index 831e13b7e..7362a3ccf 100644
--- a/lib/pleroma/web/activity_pub/utils.ex
+++ b/lib/pleroma/web/activity_pub/utils.ex
@@ -7,18 +7,15 @@ defmodule Pleroma.Web.ActivityPub.Utils do
# Some implementations send the actor URI as the actor field, others send the entire actor object,
# so figure out what the actor's URI is based on what we have.
- def normalize_actor(actor) do
- cond do
- is_binary(actor) ->
- actor
-
- is_map(actor) ->
- actor["id"]
+ def get_ap_id(object) do
+ case object do
+ %{"id" => id} -> id
+ id -> id
end
end
def normalize_params(params) do
- Map.put(params, "actor", normalize_actor(params["actor"]))
+ Map.put(params, "actor", get_ap_id(params["actor"]))
end
def make_json_ld_header do