[Pleroma.Web.MastodonApi.MastodonApiController] Add /api/v2/search
[akkoma] / lib / pleroma / web / router.ex
index ea134bbff2c3e545fe3dd39b9c2b6d662ac42326..ebe68218b3992e4b8d18cf24d61ba67c22b92445 100644 (file)
@@ -41,7 +41,7 @@ defmodule Pleroma.Web.Router do
   end
 
   pipeline :well_known do
-    plug(:accepts, ["xml", "xrd+xml", "json", "jrd+json"])
+    plug(:accepts, ["json", "jrd+json", "xml", "xrd+xml"])
   end
 
   pipeline :config do
@@ -105,7 +105,6 @@ defmodule Pleroma.Web.Router do
 
     get("/blocks", MastodonAPIController, :blocks)
 
-    get("/domain_blocks", MastodonAPIController, :empty_array)
     get("/mutes", MastodonAPIController, :empty_array)
 
     get("/timelines/home", MastodonAPIController, :home_timeline)
@@ -171,9 +170,16 @@ defmodule Pleroma.Web.Router do
     get("/accounts/:id/following", MastodonAPIController, :following)
     get("/accounts/:id", MastodonAPIController, :user)
 
+    get("/trends", MastodonAPIController, :empty_array)
+
     get("/search", MastodonAPIController, :search)
   end
 
+  scope "/api/v2", Pleroma.Web.MastodonAPI do
+    pipe_through(:api)
+    get("/search", MastodonAPIController, :search2)
+  end
+
   scope "/api", Pleroma.Web do
     pipe_through(:config)
 
@@ -245,9 +251,12 @@ defmodule Pleroma.Web.Router do
 
     post("/statuses/update", TwitterAPI.Controller, :status_update)
     post("/statuses/retweet/:id", TwitterAPI.Controller, :retweet)
+    post("/statuses/unretweet/:id", TwitterAPI.Controller, :unretweet)
     post("/statuses/destroy/:id", TwitterAPI.Controller, :delete_post)
 
     get("/pleroma/friend_requests", TwitterAPI.Controller, :friend_requests)
+    post("/pleroma/friendships/approve", TwitterAPI.Controller, :approve_friend_request)
+    post("/pleroma/friendships/deny", TwitterAPI.Controller, :deny_friend_request)
 
     post("/friendships/create", TwitterAPI.Controller, :follow)
     post("/friendships/destroy", TwitterAPI.Controller, :unfollow)