diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/matrix_controller.ex | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pleroma/web/matrix_controller.ex b/lib/pleroma/web/matrix_controller.ex index 00f27924d..23c776ca6 100644 --- a/lib/pleroma/web/matrix_controller.ex +++ b/lib/pleroma/web/matrix_controller.ex @@ -428,7 +428,14 @@ defmodule Pleroma.Web.MatrixController do end # Just pretend it worked - def set_read_marker(conn, _) do + def set_read_marker(%{assigns: %{user: %{id: user_id}}} = conn, %{ + "m.fully_read" => read_up_to, + "room_id" => chat_id + }) do + with %Chat{user_id: ^user_id} = chat <- Chat.get_by_id(chat_id) do + MessageReference.set_all_seen_for_chat(chat, read_up_to) + end + conn |> json(%{}) end |