aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-08-21 18:04:19 +0200
committerlain <lain@soykaf.club>2020-08-21 18:04:19 +0200
commitb5ea5fe851e404c3b1fca90eb4a57e6a34ff205a (patch)
tree1207921790a9adccb67b58dd9a9486b309f65033
parent4bbdeadccb6f7a8474702da96b238fbf86d85b6a (diff)
downloadpleroma-b5ea5fe851e404c3b1fca90eb4a57e6a34ff205a.tar.gz
.
-rw-r--r--lib/pleroma/web/matrix_controller.ex13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/pleroma/web/matrix_controller.ex b/lib/pleroma/web/matrix_controller.ex
index 11cb57142..d02d5859b 100644
--- a/lib/pleroma/web/matrix_controller.ex
+++ b/lib/pleroma/web/matrix_controller.ex
@@ -276,8 +276,19 @@ defmodule Pleroma.Web.MatrixController do
Map.merge(acc, room)
end)
+ most_recent_cmr_id =
+ Enum.reduce(chats, nil, fn {_k, chat}, acc ->
+ id = List.first(chat.timeline.events).event_id
+
+ if !acc || (acc && acc < id) do
+ id
+ else
+ acc
+ end
+ end)
+
data = %{
- next_batch: "next",
+ next_batch: most_recent_cmr_id,
rooms: %{
join: chats,
invite: %{},