aboutsummaryrefslogtreecommitdiff
path: root/lib/Matrix/Client.rakumod
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2021-07-08 17:22:38 -0300
committerMatias Linares <matiaslina@gmail.com>2021-07-08 17:25:36 -0300
commit7e3b798983fa11352fb19fe382b7a1217c8dbce3 (patch)
treeda2e85b2ea56374f6babd3c2d27573dd02ba7387 /lib/Matrix/Client.rakumod
parent46f9a0d6c1b55413c9cf097a12b7434bbe8e6336 (diff)
downloadperl6-matrix-client-7e3b798983fa11352fb19fe382b7a1217c8dbce3.tar.gz
Fix params with dashes
Couple of endpoints were passing parameters with dash on the JSON body intead of an underscore. This fixes he following methods: - ban - unban - invite - kick
Diffstat (limited to 'lib/Matrix/Client.rakumod')
-rw-r--r--lib/Matrix/Client.rakumod25
1 files changed, 7 insertions, 18 deletions
diff --git a/lib/Matrix/Client.rakumod b/lib/Matrix/Client.rakumod
index 5c5751f..0c801d6 100644
--- a/lib/Matrix/Client.rakumod
+++ b/lib/Matrix/Client.rakumod
@@ -235,46 +235,35 @@ method join-room($room-id!) {
#| POST - /_matrix/client/r0/rooms/{roomId}/ban
method ban(Str $room-id, Str $user-id, $reason = "") {
- $.post(
- "/rooms/$room-id/ban",
- :$user-id,
- :$reason
- );
+ $.room($room-id).ban($user-id, :$reason)
}
#| POST - /_matrix/client/r0/rooms/{roomId}/unban
method unban(Str $room-id, Str $user-id) {
- $.post(
- "/rooms/$room-id/unban",
- :$user-id
- );
+ $.room($room-id).unban($user-id)
}
#| POST - /_matrix/client/r0/rooms/{roomId}/invite
method invite(Str $room-id, Str $user-id) {
- $.post(
- "/rooms/$room-id/invite",
- :$user-id
- )
+ $.room($room-id).invite($user-id)
}
#| POST - /_matrix/client/r0/rooms/{roomId}/forget
method forget(Str $room-id) {
- $.post("/rooms/$room-id/forget")
+ $.room($room-id).forget()
}
#| POST - /_matrix/client/r0/rooms/{roomId}/kick
method kick(Str $room-id, Str $user-id, $reason = "") {
- $.post(
- "/rooms/$room-id/kick",
- :$user-id,
+ $.room($room-id).kick(
+ $user-id,
:$reason
);
}
#| POST - /_matrix/client/r0/rooms/{roomId}/leave
method leave-room($room-id) {
- $.post("/rooms/$room-id/leave");
+ $.room($room-id).leave
}
#| GET - /_matrix/client/r0/joined_rooms