From 846f9af582cd2d68331a334e2933d2b3c82ad099 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Wed, 12 Apr 2017 19:21:00 -0300 Subject: Don't sync every time the rooms and delete room-id param from send method --- lib/Matrix/Client/Room.pm6 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/Matrix/Client') 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; @@ -36,7 +34,7 @@ method messages() { return $data.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) } -- cgit v1.2.3-70-g09d2