summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2017-04-12 19:21:00 -0300
committerMatias Linares <matiaslina@openmailbox.org>2017-04-12 19:21:00 -0300
commit846f9af582cd2d68331a334e2933d2b3c82ad099 (patch)
treea95c563dd5f1ebbc8f11f72029af416690a8da65
parent5dcec83e6430da3abb0e5725b58fab85bd0adb8f (diff)
downloadperl6-matrix-client-846f9af582cd2d68331a334e2933d2b3c82ad099.tar.gz
Don't sync every time the rooms and delete room-id param from send
method
-rw-r--r--lib/Matrix/Client/Room.pm66
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Matrix/Client/Room.pm6 b/lib/Matrix/Client/Room.pm6
index 5601f33..08caf0f 100644
--- a/lib/Matrix/Client/Room.pm6
+++ b/lib/Matrix/Client/Room.pm6
@@ -8,9 +8,7 @@ has $.name is rw;
has $.id is rw;
has $!prev-batch;
-submethod BUILD(Str :$id!, :$json, :$home-server!) {
- $!home-server = $home-server;
- $!id = $id;
+submethod BUILD(Str :$!id!, :$json!, :$!home-server!, :$!access-token!) {
$!url-prefix = "/rooms/$!id";
$!prev-batch = $json<timeline><prev_batch>;
@@ -36,7 +34,7 @@ method messages() {
return $data<chunk>.clone;
}
-method send($room-id, Str $body!, Str :$type? = "m.text") {
+method send(Str $body!, Str :$type? = "m.text") {
$Matrix::Client::Common::TXN-ID++;
$.put("/send/m.room.message/{$Matrix::Client::Common::TXN-ID}", msgtype => $type, body => $body)
}