aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--endpoints.md4
-rw-r--r--lib/Matrix/Client.pm617
2 files changed, 19 insertions, 2 deletions
diff --git a/endpoints.md b/endpoints.md
index 9abcf1a..2ee313e 100644
--- a/endpoints.md
+++ b/endpoints.md
@@ -82,14 +82,14 @@ from matrix.org. This will give you an overview about what's implemented in the
- [X] GET - /_matrix/client/r0/joined_rooms
- [X] POST - /_matrix/client/r0/join/{roomIdOrAlias}
-- [ ] POST - /_matrix/client/r0/rooms/{roomId}/ban
+- [X] POST - /_matrix/client/r0/rooms/{roomId}/ban
- [ ] POST - /_matrix/client/r0/rooms/{roomId}/forget
- [ ] POST - /_matrix/client/r0/rooms/{roomId}/invite
- [ ] POST - /_matrix/client/r0/rooms/{roomId}/invite
- [ ] POST - /_matrix/client/r0/rooms/{roomId}/join
- [ ] POST - /_matrix/client/r0/rooms/{roomId}/kick
- [X] POST - /_matrix/client/r0/rooms/{roomId}/leave
-- [ ] POST - /_matrix/client/r0/rooms/{roomId}/unban
+- [X] POST - /_matrix/client/r0/rooms/{roomId}/unban
## Room participation
diff --git a/lib/Matrix/Client.pm6 b/lib/Matrix/Client.pm6
index 2fdbf4b..a19918b 100644
--- a/lib/Matrix/Client.pm6
+++ b/lib/Matrix/Client.pm6
@@ -202,6 +202,23 @@ method join-room($room-id!) {
$.post("/join/$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
+ );
+}
+
+#| POST - /_matrix/client/r0/rooms/{roomId}/unban
+method unban(Str $room-id, Str $user-id) {
+ $.post(
+ "/rooms/$room-id/unban",
+ :$user-id
+ );
+}
+
#| POST - /_matrix/client/r0/rooms/{roomId}/leave
method leave-room($room-id) {
$.post("/rooms/$room-id/leave");