Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pleroma
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
406
Issues
406
List
Boards
Labels
Service Desk
Milestones
Merge Requests
59
Merge Requests
59
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pleroma
pleroma
Commits
b30fb1f3
Verified
Commit
b30fb1f3
authored
Mar 29, 2020
by
Haelwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User: Fix use of source_data in profile_url/1
parent
2553400a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
lib/pleroma/user.ex
lib/pleroma/user.ex
+3
-2
test/web/mastodon_api/views/account_view_test.exs
test/web/mastodon_api/views/account_view_test.exs
+3
-1
No files found.
lib/pleroma/user.ex
View file @
b30fb1f3
...
...
@@ -305,7 +305,8 @@ def banner_url(user, options \\ []) do
end
end
def
profile_url
(%
User
{
source_data:
%{
"url"
=>
url
}}),
do
:
url
def
profile_url
(%
User
{
uri:
url
})
when
url
!=
nil
,
do
:
url
def
profile_url
(%
User
{
source_data:
%{
"url"
=>
url
}})
when
is_binary
(
url
),
do
:
url
def
profile_url
(%
User
{
ap_id:
ap_id
}),
do
:
ap_id
def
profile_url
(
_
),
do
:
nil
...
...
@@ -314,7 +315,7 @@ def ap_id(%User{nickname: nickname}), do: "#{Web.base_url()}/users/#{nickname}"
def
ap_followers
(%
User
{
follower_address:
fa
})
when
is_binary
(
fa
),
do
:
fa
def
ap_followers
(%
User
{}
=
user
),
do
:
"
#{
ap_id
(
user
)
}
/followers"
@spec
ap_following
(
User
.
t
())
::
Sring
.
t
()
@spec
ap_following
(
User
.
t
())
::
S
t
ring
.
t
()
def
ap_following
(%
User
{
following_address:
fa
})
when
is_binary
(
fa
),
do
:
fa
def
ap_following
(%
User
{}
=
user
),
do
:
"
#{
ap_id
(
user
)
}
/following"
...
...
test/web/mastodon_api/views/account_view_test.exs
View file @
b30fb1f3
...
...
@@ -178,7 +178,9 @@ test "Represent a Funkwhale channel" do
assert
represented
=
AccountView
.
render
(
"show.json"
,
%{
user:
user
})
assert
represented
.
acct
==
"compositions@channels.tests.funkwhale.audio"
assert
represented
.
url
==
"https://channels.tests.funkwhale.audio/channels/compositions"
# assert represented.url == "https://channels.tests.funkwhale.audio/channels/compositions"
assert
represented
.
url
==
"https://channels.tests.funkwhale.audio/federation/actors/compositions"
end
test
"Represent a deactivated user for an admin"
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