diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2017-04-12 19:21:00 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2017-04-12 19:21:00 -0300 |
commit | 846f9af582cd2d68331a334e2933d2b3c82ad099 (patch) | |
tree | a95c563dd5f1ebbc8f11f72029af416690a8da65 /lib/Matrix | |
parent | 5dcec83e6430da3abb0e5725b58fab85bd0adb8f (diff) | |
download | perl6-matrix-client-846f9af582cd2d68331a334e2933d2b3c82ad099.tar.gz |
Don't sync every time the rooms and delete room-id param from send
method
Diffstat (limited to 'lib/Matrix')
-rw-r--r-- | lib/Matrix/Client/Room.pm6 | 6 |
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) } |