projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enforcement of OAuth scopes check for authenticated API endpoints, :skip_plug plug...
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
account_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/account_view.ex
b/lib/pleroma/web/mastodon_api/views/account_view.ex
index 0efcabc019b420f56c7b3a0e7f7c9f844b1ea07f..99e62f580c4f613a1ae32e3198363285fc93810f 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/account_view.ex
@@
-13,16
+13,18
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
alias Pleroma.Web.MediaProxy
def render("index.json", %{users: users} = opts) do
alias Pleroma.Web.MediaProxy
def render("index.json", %{users: users} = opts) do
+ reading_user = opts[:for]
+
relationships_opt =
cond do
Map.has_key?(opts, :relationships) ->
opts[:relationships]
relationships_opt =
cond do
Map.has_key?(opts, :relationships) ->
opts[:relationships]
- is_nil(
opts[:for]
) ->
+ is_nil(
reading_user
) ->
UserRelationship.view_relationships_option(nil, [])
true ->
UserRelationship.view_relationships_option(nil, [])
true ->
- UserRelationship.view_relationships_option(
opts[:for]
, users)
+ UserRelationship.view_relationships_option(
reading_user
, users)
end
opts = Map.put(opts, :relationships, relationships_opt)
end
opts = Map.put(opts, :relationships, relationships_opt)
@@
-43,7
+45,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
id: to_string(user.id),
acct: user.nickname,
username: username_from_nickname(user.nickname),
id: to_string(user.id),
acct: user.nickname,
username: username_from_nickname(user.nickname),
- url:
User.profile_url(user)
+ url:
user.uri || user.ap_id
}
end
}
end
@@
-143,7
+145,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
Map.has_key?(opts, :relationships) ->
opts[:relationships]
Map.has_key?(opts, :relationships) ->
opts[:relationships]
- is_nil(
opts[:for]
) ->
+ is_nil(
user
) ->
UserRelationship.view_relationships_option(nil, [])
true ->
UserRelationship.view_relationships_option(nil, [])
true ->
@@
-207,7
+209,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
following_count: following_count,
statuses_count: user.note_count,
note: user.bio || "",
following_count: following_count,
statuses_count: user.note_count,
note: user.bio || "",
- url:
User.profile_url(user)
,
+ url:
user.uri || user.ap_id
,
avatar: image,
avatar_static: image,
header: header,
avatar: image,
avatar_static: image,
header: header,