Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
[akkoma] / lib / pleroma / web / router.ex
index 9eec66e65d465fa957cca87ae18e9aeb058441b6..89db2eebd5beb73ccac34c83998374afa1864182 100644 (file)
@@ -303,6 +303,18 @@ defmodule Pleroma.Web.Router do
   end
 
   scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
+    scope [] do
+      pipe_through(:authenticated_api)
+
+      post("/chats/by-account-id/:id", ChatController, :create)
+      get("/chats", ChatController, :index)
+      get("/chats/:id", ChatController, :show)
+      get("/chats/:id/messages", ChatController, :messages)
+      post("/chats/:id/messages", ChatController, :post_chat_message)
+      delete("/chats/:id/messages/:message_id", ChatController, :delete_message)
+      post("/chats/:id/read", ChatController, :mark_as_read)
+    end
+
     scope [] do
       pipe_through(:authenticated_api)
 
@@ -326,7 +338,7 @@ defmodule Pleroma.Web.Router do
       get("/mascot", MascotController, :show)
       put("/mascot", MascotController, :update)
 
-      post("/scrobble", ScrobbleController, :new_scrobble)
+      post("/scrobble", ScrobbleController, :create)
     end
 
     scope [] do
@@ -346,7 +358,7 @@ defmodule Pleroma.Web.Router do
 
   scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
     pipe_through(:api)
-    get("/accounts/:id/scrobbles", ScrobbleController, :user_scrobbles)
+    get("/accounts/:id/scrobbles", ScrobbleController, :index)
   end
 
   scope "/api/v1", Pleroma.Web.MastodonAPI do