diff options
author | Matias Linares <matiaslina@gmail.com> | 2019-06-18 00:02:08 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2019-06-18 00:02:08 -0300 |
commit | a090293f1fb64375f5ba16b6a5e53c829eb41add (patch) | |
tree | 4c1659ad756cdb625e808bbb7399dfeebe46aecf | |
parent | 989e6afb0b9c4b43cac48918ee08d0e24c606c80 (diff) | |
download | perl6-matrix-client-a090293f1fb64375f5ba16b6a5e53c829eb41add.tar.gz |
Add invite endpoint
-rw-r--r-- | endpoints.md | 2 | ||||
-rw-r--r-- | lib/Matrix/Client.pm6 | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/endpoints.md b/endpoints.md index 2ee313e..5fbb63c 100644 --- a/endpoints.md +++ b/endpoints.md @@ -84,7 +84,7 @@ from matrix.org. This will give you an overview about what's implemented in the - [X] POST - /_matrix/client/r0/join/{roomIdOrAlias} - [X] POST - /_matrix/client/r0/rooms/{roomId}/ban - [ ] POST - /_matrix/client/r0/rooms/{roomId}/forget -- [ ] POST - /_matrix/client/r0/rooms/{roomId}/invite +- [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 diff --git a/lib/Matrix/Client.pm6 b/lib/Matrix/Client.pm6 index a19918b..86de2e8 100644 --- a/lib/Matrix/Client.pm6 +++ b/lib/Matrix/Client.pm6 @@ -219,6 +219,14 @@ method unban(Str $room-id, Str $user-id) { ); } +#| POST - /_matrix/client/r0/rooms/{roomId}/invite +method invite(Str $room-id, Str $user-id) { + $.post( + "/rooms/$room-id/invite", + :$user-id + ) +} + #| POST - /_matrix/client/r0/rooms/{roomId}/leave method leave-room($room-id) { $.post("/rooms/$room-id/leave"); |