logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

follow_request_controller.ex (949B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2024 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.PleromaAPI.FollowRequestController do
  5. use Pleroma.Web, :controller
  6. alias Pleroma.User
  7. alias Pleroma.Web.Plugs.OAuthScopesPlug
  8. plug(Pleroma.Web.ApiSpec.CastAndValidate, replace_params: false)
  9. action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
  10. plug(OAuthScopesPlug, %{scopes: ["follow", "read:follows"]})
  11. defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaFollowRequestOperation
  12. @doc "GET /api/v1/pleroma/outgoing_follow_requests"
  13. def outgoing(%{assigns: %{user: follower}} = conn, _params) do
  14. follow_requests = User.get_outgoing_follow_requests(follower)
  15. conn
  16. |> put_view(Pleroma.Web.MastodonAPI.FollowRequestView)
  17. |> render("index.json", for: follower, users: follow_requests, as: :user)
  18. end
  19. end