- Mastodon API: Add support for categories for custom emojis by reusing the group feature. <https://github.com/tootsuite/mastodon/pull/11196>
- Mastodon API: Add support for muting/unmuting notifications
- Mastodon API: Add support for the `blocked_by` attribute in the relationship API (`GET /api/v1/accounts/relationships`). <https://github.com/tootsuite/mastodon/pull/10373>
+- Mastodon API: Add `pleroma.deactivated` to the Account entity
- Admin API: Return users' tags when querying reports
- Admin API: Return avatar and display name when querying users
- Admin API: Allow querying user by ID
- `hide_follows`: boolean, true when the user has follow hiding enabled
- `settings_store`: A generic map of settings for frontends. Opaque to the backend. Only returned in `verify_credentials` and `update_credentials`
- `chat_token`: The token needed for Pleroma chat. Only returned in `verify_credentials`
+- `deactivated`: boolean, true when the user is deactivated
### Source
|> maybe_put_notification_settings(user, opts[:for])
|> maybe_put_settings_store(user, opts[:for], opts)
|> maybe_put_chat_token(user, opts[:for], opts)
+ |> maybe_put_activation_status(user, opts[:for])
end
defp username_from_nickname(string) when is_binary(string) do
defp maybe_put_notification_settings(data, _, _), do: data
+ defp maybe_put_activation_status(data, user, %User{info: %{is_admin: true}}) do
+ Kernel.put_in(data, [:pleroma, :deactivated], user.info.deactivated)
+ end
+
+ defp maybe_put_activation_status(data, _, _), do: data
+
defp image_url(%{"url" => [%{"href" => href} | _]}), do: href
defp image_url(_), do: nil
end
assert expected == AccountView.render("account.json", %{user: user})
end
+ test "Represent a deactivated user for an admin" do
+ admin = insert(:user, %{info: %{is_admin: true}})
+ deactivated_user = insert(:user, %{info: %{deactivated: true}})
+ represented = AccountView.render("account.json", %{user: deactivated_user, for: admin})
+ assert represented[:pleroma][:deactivated] == true
+ end
+
test "Represent a smaller mention" do
user = insert(:user)