Merge branch 'develop' into openapi/notifications
authorEgor Kislitsyn <egor@kislitsyn.com>
Thu, 30 Apr 2020 09:52:07 +0000 (13:52 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Thu, 30 Apr 2020 09:52:07 +0000 (13:52 +0400)
1  2 
lib/pleroma/web/api_spec/operations/account_operation.ex
lib/pleroma/web/mastodon_api/controllers/notification_controller.ex
lib/pleroma/web/router.ex

index dcb421756631931b7c4c09547c317e919170f264,31140527783f6bd90c3f0ae413fe689d302c3483..a14c86893b3d7aa815a52a4dc6385a05fe1b4ff0
@@@ -22,12 -20,8 +22,10 @@@ defmodule Pleroma.Web.MastodonAPI.Notif
  
    plug(OAuthScopesPlug, %{scopes: ["write:notifications"]} when action not in @oauth_read_actions)
  
-   plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
 +  defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.NotificationOperation
 +
    # GET /api/v1/notifications
 -  def index(conn, %{"account_id" => account_id} = params) do
 +  def index(conn, %{account_id: account_id} = params) do
      case Pleroma.User.get_cached_by_id(account_id) do
        %{ap_id: account_ap_id} ->
          params =
index fe984b06c46ac6357c42bcc2d87161b777c4d50a,becce3098f3838d39ac7c641b25187159fc7389a..ab6ae9415d0b37689ac1dd88f991fa8b44f459c0
@@@ -344,27 -396,21 +396,21 @@@ defmodule Pleroma.Web.Router d
      post("/notifications/clear", NotificationController, :clear)
      delete("/notifications/destroy_multiple", NotificationController, :destroy_multiple)
      # Deprecated: was removed in Mastodon v3, use `/notifications/:id/dismiss` instead
 -    post("/notifications/dismiss", NotificationController, :dismiss)
 +    post("/notifications/dismiss", NotificationController, :dismiss_via_body)
  
-     get("/scheduled_statuses", ScheduledActivityController, :index)
-     get("/scheduled_statuses/:id", ScheduledActivityController, :show)
-     get("/lists", ListController, :index)
-     get("/lists/:id", ListController, :show)
-     get("/lists/:id/accounts", ListController, :list_accounts)
-     get("/domain_blocks", DomainBlockController, :index)
-     get("/filters", FilterController, :index)
+     post("/polls/:id/votes", PollController, :vote)
  
-     get("/suggestions", SuggestionController, :index)
+     post("/reports", ReportController, :create)
  
-     get("/conversations", ConversationController, :index)
-     post("/conversations/:id/read", ConversationController, :read)
+     get("/scheduled_statuses", ScheduledActivityController, :index)
+     get("/scheduled_statuses/:id", ScheduledActivityController, :show)
  
-     get("/endorsements", AccountController, :endorsements)
+     put("/scheduled_statuses/:id", ScheduledActivityController, :update)
+     delete("/scheduled_statuses/:id", ScheduledActivityController, :delete)
  
-     patch("/accounts/update_credentials", AccountController, :update_credentials)
+     # Unlike `GET /api/v1/accounts/:id/favourites`, demands authentication
+     get("/favourites", StatusController, :favourites)
+     get("/bookmarks", StatusController, :bookmarks)
  
      post("/statuses", StatusController, :create)
      delete("/statuses/:id", StatusController, :delete)