aboutsummaryrefslogtreecommitdiff
path: root/lib/Matrix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Matrix')
-rw-r--r--lib/Matrix/Client.rakumod25
-rw-r--r--lib/Matrix/Client/Room.rakumod6
2 files changed, 10 insertions, 21 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
diff --git a/lib/Matrix/Client/Room.rakumod b/lib/Matrix/Client/Room.rakumod
index 1a6908f..8b86108 100644
--- a/lib/Matrix/Client/Room.rakumod
+++ b/lib/Matrix/Client/Room.rakumod
@@ -191,19 +191,19 @@ method forget {
#| POST - /_matrix/client/r0/rooms/{roomId}/kick
method kick(Str $user-id, Str $reason = "") {
- $.post('/kick', :$user-id, :$reason)
+ $.post('/kick', :user_id($user-id), :$reason)
}
## Banning users
#| POST - /_matrix/client/r0/rooms/{roomId}/ban
method ban(Str $user-id, $reason = "") {
- $.post('/ban', :$user-id, :$reason)
+ $.post('/ban', :user_id($user-id), :$reason)
}
#| POST - /_matrix/client/r0/rooms/{roomId}/unban
method unban(Str $user-id) {
- $.post('/unban', :$user-id)
+ $.post('/unban', :user_id($user-id))
}
method Str(--> Str) {