Merge branch '1851-favorites-pagination' into 'develop'
[akkoma] / lib / pleroma / web / pleroma_api / controllers / chat_controller.ex
index b9949236c5a5074369da4647048b856b72768332..c8ef3d91511a247531749918bb981ec79e592687 100644 (file)
@@ -17,7 +17,6 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
   alias Pleroma.Web.PleromaAPI.ChatView
 
   import Ecto.Query
-  import Pleroma.Web.ActivityPub.ObjectValidator, only: [stringify_keys: 1]
 
   action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
 
@@ -127,7 +126,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
       cm_refs =
         chat
         |> MessageReference.for_chat_query()
-        |> Pagination.fetch_paginated(params |> stringify_keys())
+        |> Pagination.fetch_paginated(params)
 
       conn
       |> put_view(MessageReferenceView)
@@ -140,7 +139,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
     end
   end
 
-  def index(%{assigns: %{user: %{id: user_id} = user}} = conn, params) do
+  def index(%{assigns: %{user: %{id: user_id} = user}} = conn, _params) do
     blocked_ap_ids = User.blocked_users_ap_ids(user)
 
     chats =
@@ -149,7 +148,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
         where: c.recipient not in ^blocked_ap_ids,
         order_by: [desc: c.updated_at]
       )
-      |> Pagination.fetch_paginated(params |> stringify_keys)
+      |> Repo.all()
 
     conn
     |> put_view(ChatView)