summaryrefslogtreecommitdiff
path: root/lib/Matrix/Client.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Matrix/Client.pm6')
-rw-r--r--lib/Matrix/Client.pm615
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Matrix/Client.pm6 b/lib/Matrix/Client.pm6
index 1e080bd..5f52779 100644
--- a/lib/Matrix/Client.pm6
+++ b/lib/Matrix/Client.pm6
@@ -197,6 +197,21 @@ method send(Str $room-id, Str $body, :$type? = "m.text") {
from-json($res.content)<event_id>
}
+method get-room-id($room-alias) {
+ my $res = $.get("/directory/room/$room-alias");
+
+ from-json($res.content)<room_id>
+}
+
+method add-room-alias($room-id, $room-alias) {
+ $.put("/directory/room/$room-alias",
+ room_id => $room-id);
+}
+
+method remove-room-alias($room-alias) {
+ $.delete("/directory/room/$room-alias");
+}
+
# Media
method upload(IO::Path $path, Str $filename?) {