Merge branch 'develop' into 'remove-avatar-header'
# Conflicts: # CHANGELOG.md
This commit is contained in:
commit
a0c65bbd6c
237 changed files with 8534 additions and 2226 deletions
|
|
@ -667,7 +667,15 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
|
||||
defp build_info_cng(user, params) do
|
||||
info_params =
|
||||
["no_rich_text", "locked", "hide_followers", "hide_follows", "hide_favorites", "show_role"]
|
||||
[
|
||||
"no_rich_text",
|
||||
"locked",
|
||||
"hide_followers",
|
||||
"hide_follows",
|
||||
"hide_favorites",
|
||||
"show_role",
|
||||
"skip_thread_containment"
|
||||
]
|
||||
|> Enum.reduce(%{}, fn key, res ->
|
||||
if value = params[key] do
|
||||
Map.put(res, key, value == "true")
|
||||
|
|
@ -763,7 +771,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
def only_if_public_instance(%{assigns: %{user: %User{}}} = conn, _), do: conn
|
||||
|
||||
def only_if_public_instance(conn, _) do
|
||||
if Keyword.get(Application.get_env(:pleroma, :instance), :public) do
|
||||
if Pleroma.Config.get([:instance, :public]) do
|
||||
conn
|
||||
else
|
||||
conn
|
||||
|
|
|
|||
|
|
@ -118,9 +118,11 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
|
|||
"pleroma" =>
|
||||
%{
|
||||
"confirmation_pending" => user_info.confirmation_pending,
|
||||
"tags" => user.tags
|
||||
"tags" => user.tags,
|
||||
"skip_thread_containment" => user.info.skip_thread_containment
|
||||
}
|
||||
|> maybe_with_activation_status(user, for_user)
|
||||
|> with_notification_settings(user, for_user)
|
||||
}
|
||||
|> maybe_with_user_settings(user, for_user)
|
||||
|> maybe_with_role(user, for_user)
|
||||
|
|
@ -132,6 +134,12 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
|
|||
end
|
||||
end
|
||||
|
||||
defp with_notification_settings(data, %User{id: user_id} = user, %User{id: user_id}) do
|
||||
Map.put(data, "notification_settings", user.info.notification_settings)
|
||||
end
|
||||
|
||||
defp with_notification_settings(data, _, _), do: data
|
||||
|
||||
defp maybe_with_activation_status(data, user, %User{info: %{is_admin: true}}) do
|
||||
Map.put(data, "deactivated", user.info.deactivated)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue