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
847cb156
Commit
847cb156
authored
Mar 24, 2018
by
lain
Browse files
Fix tests.
parent
c7be7a94
Pipeline
#969
passed with stage
in 2 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user.ex
View file @
847cb156
...
...
@@ -458,4 +458,12 @@ def insert_or_update_user(data) do
def
ap_enabled?
(%
User
{
info:
info
}),
do
:
info
[
"ap_enabled"
]
def
ap_enabled?
(
_
),
do
:
false
def
get_or_fetch
(
uri_or_nickname
)
do
if
String
.
starts_with?
(
uri_or_nickname
,
"http"
)
do
get_or_fetch_by_ap_id
(
uri_or_nickname
)
else
get_or_fetch_by_nickname
(
uri_or_nickname
)
end
end
end
lib/pleroma/web/twitter_api/twitter_api.ex
View file @
847cb156
...
...
@@ -328,8 +328,7 @@ def conversation_id_to_context(id) do
end
def
get_external_profile
(
for_user
,
uri
)
do
IO
.
inspect
(
uri
)
with
%
User
{}
=
user
<-
User
.
get_or_fetch_by_nickname
(
uri
)
do
with
%
User
{}
=
user
<-
User
.
get_or_fetch
(
uri
)
do
spawn
(
fn
->
with
url
<-
user
.
info
[
"topic"
],
{
:ok
,
%{
body:
body
}}
<-
@httpoison
.
get
(
url
,
[],
follow_redirect:
true
,
timeout:
10000
,
recv_timeout:
20000
)
do
...
...
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