aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-11-17 20:13:38 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-11-17 20:16:03 +0000
commitc88533209c20eeae51dcdc029db9483f8e69d096 (patch)
tree06f73e0b767a623cbb4a419ea79ad2f464fad346
parent1a940cb46e1fb06b391043ae2efa3ac0d3c49fe0 (diff)
downloadpleroma-c88533209c20eeae51dcdc029db9483f8e69d096.tar.gz
activitypub: user fetching: use fetch_and_contain_remote_object_from_id()
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 98e9e2120..ed579e336 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -628,9 +628,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
def fetch_and_prepare_user_from_ap_id(ap_id) do
- with {:ok, %{status_code: 200, body: body}} <-
- @httpoison.get(ap_id, [Accept: "application/activity+json"], follow_redirect: true),
- {:ok, data} <- Jason.decode(body) do
+ with {:ok, data} <- fetch_and_contain_remote_object_from_id(ap_id) do
user_data_from_user_object(data)
else
e -> Logger.error("Could not decode user at fetch #{ap_id}, #{inspect(e)}")