diff options
-rw-r--r-- | docs/Matrix/Client/Room.rakudoc | 9 | ||||
-rw-r--r-- | lib/Matrix/Client/Room.rakumod | 10 | ||||
-rw-r--r-- | t/30-room.t | 1 |
3 files changed, 19 insertions, 1 deletions
diff --git a/docs/Matrix/Client/Room.rakudoc b/docs/Matrix/Client/Room.rakudoc index 7d4cdff..bd0f6fd 100644 --- a/docs/Matrix/Client/Room.rakudoc +++ b/docs/Matrix/Client/Room.rakudoc @@ -138,6 +138,15 @@ read receipt's location. The C<$fully-read> and C<$read> parameters are event ids where the markers will be placed. +=head2 typing + + method typing(Bool $typing, Str :$user-id!, Int :$timeout) + +Sends a typing event to the server telling that C<$user-id> is typing +or not (depending on C<$typing> argument). + +The C<$timeout> parameter is optional for this endpoint. + =head2 invite method invite(Str $user-id) diff --git a/lib/Matrix/Client/Room.rakumod b/lib/Matrix/Client/Room.rakumod index 34c73ae..1a6908f 100644 --- a/lib/Matrix/Client/Room.rakumod +++ b/lib/Matrix/Client/Room.rakumod @@ -153,7 +153,15 @@ method read-marker(Str:D $fully-read, Str $read?) { $.post('/read_markers', |%data); } -method typing() +#| PUT - /_matrix/client/r0/rooms/{roomId}/typing/{userId} +method typing(Bool $typing, Str :$user-id!, Int :$timeout) { + my %data = :$typing; + + %data<timeout> = $timeout with $timeout; + $.put( + "/typing/{$user-id}", |%data + ); +} # Room membership! diff --git a/t/30-room.t b/t/30-room.t index b9f7cfd..7eb9dd7 100644 --- a/t/30-room.t +++ b/t/30-room.t @@ -7,6 +7,7 @@ use-ok 'Matrix::Client::Room'; my $room = Matrix::Client::Room.new(:home-server<test>, :id<!something>); can-ok $room, 'read-marker'; +can-ok $room, 'typing'; # Integrations tests; |