diff options
Diffstat (limited to 'lib/polyjuice/client/room.ex')
-rw-r--r-- | lib/polyjuice/client/room.ex | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/polyjuice/client/room.ex b/lib/polyjuice/client/room.ex index 62009f9..7435244 100644 --- a/lib/polyjuice/client/room.ex +++ b/lib/polyjuice/client/room.ex @@ -334,4 +334,32 @@ defmodule Polyjuice.Client.Room do } ) end + + @doc """ + Set up the read receipt marker positions for a given room + The history for a given room may be split into three sections: + messages the user has read (or indicated they aren't interested in them), + messages the user might have read some but not others, and messages the user hasn't seen yet. + The "fully read marker" (also known as a "read marker") marks the last event of the first section, + whereas the user's read receipt marks the last event of the second section. + it takes: + `fully_read`: the event id the read marker should be located at + `read`: the event id the to which the read receipt should be be up to + """ + @spec update_read_markers( + client_api :: Polyjuice.Client.API.t(), + room :: String.t(), + fully_read :: String.t(), + read :: String.t() | nil + ) :: {:ok} | any + def update_read_markers(client_api, room, fully_read, read \\ nil) do + Polyjuice.Client.API.call( + client_api, + %Polyjuice.Client.Endpoint.PostRoomsReadMarkers{ + room: room, + fully_read: fully_read, + read: read + } + ) + end end |