Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
c8853320
Commit
c8853320
authored
Nov 17, 2018
by
kaniini
Browse files
activitypub: user fetching: use fetch_and_contain_remote_object_from_id()
parent
1a940cb4
Pipeline
#4542
passed with stages
in 6 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/activity_pub.ex
View file @
c8853320
...
@@ -628,9 +628,7 @@ def user_data_from_user_object(data) do
...
@@ -628,9 +628,7 @@ def user_data_from_user_object(data) do
end
end
def
fetch_and_prepare_user_from_ap_id
(
ap_id
)
do
def
fetch_and_prepare_user_from_ap_id
(
ap_id
)
do
with
{
:ok
,
%{
status_code:
200
,
body:
body
}}
<-
with
{
:ok
,
data
}
<-
fetch_and_contain_remote_object_from_id
(
ap_id
)
do
@httpoison
.
get
(
ap_id
,
[
Accept:
"application/activity+json"
],
follow_redirect:
true
),
{
:ok
,
data
}
<-
Jason
.
decode
(
body
)
do
user_data_from_user_object
(
data
)
user_data_from_user_object
(
data
)
else
else
e
->
Logger
.
error
(
"Could not decode user at fetch
#{
ap_id
}
,
#{
inspect
(
e
)
}
"
)
e
->
Logger
.
error
(
"Could not decode user at fetch
#{
ap_id
}
,
#{
inspect
(
e
)
}
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment