Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dex
pleroma
Commits
b3e7d7ae
Commit
b3e7d7ae
authored
7 years ago
by
eal
Browse files
Options
Downloads
Patches
Plain Diff
Fetch external profile in the background.
parent
80f6ac41
Branches
fix-tootdon-image-uploads
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/pleroma/web/twitter_api/twitter_api.ex
+6
-4
6 additions, 4 deletions
lib/pleroma/web/twitter_api/twitter_api.ex
test/web/twitter_api/twitter_api_test.exs
+1
-1
1 addition, 1 deletion
test/web/twitter_api/twitter_api_test.exs
with
7 additions
and
5 deletions
lib/pleroma/web/twitter_api/twitter_api.ex
+
6
−
4
View file @
b3e7d7ae
...
...
@@ -316,10 +316,12 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
def
get_external_profile
(
for_user
,
uri
)
do
with
{
:ok
,
%
User
{}
=
user
}
<-
OStatus
.
find_or_make_user
(
uri
)
do
with
url
<-
user
.
info
[
"topic"
],
{
:ok
,
%{
body:
body
}}
<-
@httpoison
.
get
(
url
,
[],
follow_redirect:
true
,
timeout:
10000
,
recv_timeout:
20000
)
do
OStatus
.
handle_incoming
(
body
)
end
spawn
(
fn
->
with
url
<-
user
.
info
[
"topic"
],
{
:ok
,
%{
body:
body
}}
<-
@httpoison
.
get
(
url
,
[],
follow_redirect:
true
,
timeout:
10000
,
recv_timeout:
20000
)
do
OStatus
.
handle_incoming
(
body
)
end
end
)
{
:ok
,
UserView
.
render
(
"show.json"
,
%{
user:
user
,
for:
for_user
})}
else
_e
->
{
:error
,
"Couldn't find user"
}
...
...
This diff is collapsed.
Click to expand it.
test/web/twitter_api/twitter_api_test.exs
+
1
−
1
View file @
b3e7d7ae
...
...
@@ -404,7 +404,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
assert
represented
[
"id"
]
==
UserView
.
render
(
"show.json"
,
%{
user:
remote
,
for:
user
})[
"id"
]
# Also fetches the feed.
assert
Activity
.
get_create_activity_by_object_ap_id
(
"tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status"
)
#
assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment