diff options
-rw-r--r-- | lib/pleroma/web/matrix_controller.ex | 8 | ||||
-rw-r--r-- | test/web/matrix_controller_test.exs | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/lib/pleroma/web/matrix_controller.ex b/lib/pleroma/web/matrix_controller.ex index cb2e6df73..a767c7cdb 100644 --- a/lib/pleroma/web/matrix_controller.ex +++ b/lib/pleroma/web/matrix_controller.ex @@ -292,16 +292,12 @@ defmodule Pleroma.Web.MatrixController do } } - if length(messages) > 0 do - Map.merge(acc, room) - else - acc - end + Map.merge(acc, room) end) most_recent_cmr_id = Enum.reduce(chats, nil, fn {_k, chat}, acc -> - id = List.last(chat.timeline.events).event_id + id = List.last(chat.timeline.events)[:event_id] if !acc || (acc && acc < id) do id diff --git a/test/web/matrix_controller_test.exs b/test/web/matrix_controller_test.exs index ec24855e0..0a74ea9f4 100644 --- a/test/web/matrix_controller_test.exs +++ b/test/web/matrix_controller_test.exs @@ -118,7 +118,7 @@ defmodule Pleroma.Web.MatrixControllerTest do |> get("_matrix/client/r0/sync?since=#{cmr_two.id}") |> json_response(200) - refute joined_rooms[chat_two.id] + assert joined_rooms[chat_two.id] assert chat_room = joined_rooms[chat.id] assert [message] = chat_room["timeline"]["events"] assert message["content"]["body"] == "morning weebs" |