summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--endpoints.md4
-rw-r--r--lib/Matrix/Client.pm614
2 files changed, 16 insertions, 2 deletions
diff --git a/endpoints.md b/endpoints.md
index 5fbb63c..8b22289 100644
--- a/endpoints.md
+++ b/endpoints.md
@@ -83,11 +83,11 @@ 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}
- [X] POST - /_matrix/client/r0/rooms/{roomId}/ban
-- [ ] POST - /_matrix/client/r0/rooms/{roomId}/forget
+- [X] POST - /_matrix/client/r0/rooms/{roomId}/forget
- [X] 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}/kick
- [X] POST - /_matrix/client/r0/rooms/{roomId}/leave
- [X] POST - /_matrix/client/r0/rooms/{roomId}/unban
diff --git a/lib/Matrix/Client.pm6 b/lib/Matrix/Client.pm6
index 86de2e8..6d60660 100644
--- a/lib/Matrix/Client.pm6
+++ b/lib/Matrix/Client.pm6
@@ -227,6 +227,20 @@ method invite(Str $room-id, Str $user-id) {
)
}
+#| POST - /_matrix/client/r0/rooms/{roomId}/forget
+method forget(Str $room-id) {
+ $.post("/rooms/$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,
+ :$reason
+ );
+}
+
#| POST - /_matrix/client/r0/rooms/{roomId}/leave
method leave-room($room-id) {
$.post("/rooms/$room-id/leave");