From f3f846be62f3715ad2a716043c8e92806c2472fa Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 28 Mar 2021 19:14:56 -0300 Subject: Add read-markers api support --- lib/Matrix/Client/Room.rakumod | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Matrix/Client/Room.rakumod b/lib/Matrix/Client/Room.rakumod index 1e8c582..34c73ae 100644 --- a/lib/Matrix/Client/Room.rakumod +++ b/lib/Matrix/Client/Room.rakumod @@ -6,7 +6,7 @@ use Matrix::Client::Response; unit class Matrix::Client::Room does Matrix::Client::Requester; has $!name; -has $.id; +has $.id is required; submethod TWEAK { $!url-prefix = "/rooms/$!id"; @@ -142,6 +142,19 @@ method send-state(Str:D $event-type, :$state-key = "", *%args --> Str) { from-json($res.content) } +#| POST - /_matrix/client/r0/rooms/{roomId}/read_markers +method read-marker(Str:D $fully-read, Str $read?) { + my %data = %( + "m.fully_read" => $fully-read + ); + + %data = $read with $read; + + $.post('/read_markers', |%data); +} + +method typing() + # Room membership! ## Joining rooms -- cgit v1.2.3-70-g09d2