Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

36 líneas
1.0KB

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
  5. @moduledoc """
  6. Contains stubs for unimplemented Mastodon API endpoints.
  7. Note: instead of routing directly to this controller's action,
  8. it's preferable to define an action in relevant (non-generic) controller,
  9. set up OAuth rules for it and call this controller's function from it.
  10. """
  11. use Pleroma.Web, :controller
  12. require Logger
  13. plug(
  14. :skip_plug,
  15. [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
  16. when action in [:empty_array, :empty_object]
  17. )
  18. action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
  19. def empty_array(conn, _) do
  20. Logger.debug("Unimplemented, returning an empty array (list)")
  21. json(conn, [])
  22. end
  23. def empty_object(conn, _) do
  24. Logger.debug("Unimplemented, returning an empty object (map)")
  25. json(conn, %{})
  26. end
  27. end