projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[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 32f1ad5b19bd3a6a0014209401143b3b9c64c48c..c46517e49183ad5aca9ad58347365c84964c74b2 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/account_view.ex
@@
-74,7
+74,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
followed_by =
if following_relationships do
case FollowingRelationship.find(following_relationships, target, reading_user) do
followed_by =
if following_relationships do
case FollowingRelationship.find(following_relationships, target, reading_user) do
- %{state:
"accept"
} -> true
+ %{state:
:follow_accept
} -> true
_ -> false
end
else
_ -> false
end
else
@@
-84,7
+84,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
# NOTE: adjust UserRelationship.view_relationships_option/2 on new relation-related flags
%{
id: to_string(target.id),
# NOTE: adjust UserRelationship.view_relationships_option/2 on new relation-related flags
%{
id: to_string(target.id),
- following: follow_state ==
"accept"
,
+ following: follow_state ==
:follow_accept
,
followed_by: followed_by,
blocking:
UserRelationship.exists?(
followed_by: followed_by,
blocking:
UserRelationship.exists?(
@@
-126,7
+126,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
reading_user,
&User.subscribed_to?(&2, &1)
),
reading_user,
&User.subscribed_to?(&2, &1)
),
- requested: follow_state ==
"pending"
,
+ requested: follow_state ==
:follow_pending
,
domain_blocking: User.blocks_domain?(reading_user, target),
showing_reblogs:
not UserRelationship.exists?(
domain_blocking: User.blocks_domain?(reading_user, target),
showing_reblogs:
not UserRelationship.exists?(
@@
-181,13
+181,11
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
bot = user.actor_type in ["Application", "Service"]
emojis =
bot = user.actor_type in ["Application", "Service"]
emojis =
- (user.source_data["tag"] || [])
- |> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
- |> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
+ Enum.map(user.emoji, fn {shortcode, url} ->
%{
%{
- "shortcode" =>
String.trim(name, ":")
,
- "url" =>
MediaProxy.url(url)
,
- "static_url" =>
MediaProxy.url(url)
,
+ "shortcode" =>
shortcode
,
+ "url" =>
url
,
+ "static_url" =>
url
,
"visible_in_picker" => false
}
end)
"visible_in_picker" => false
}
end)
@@
-234,6
+232,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
# Pleroma extension
pleroma: %{
# Pleroma extension
pleroma: %{
+ ap_id: user.ap_id,
confirmation_pending: user.confirmation_pending,
tags: user.tags,
hide_followers_count: user.hide_followers_count,
confirmation_pending: user.confirmation_pending,
tags: user.tags,
hide_followers_count: user.hide_followers_count,