aboutsummaryrefslogtreecommitdiff
path: root/lib/Matrix
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2018-08-04 18:54:22 -0300
committerMatias Linares <matiaslina@gmail.com>2018-08-04 18:54:22 -0300
commit007f12ce41d0331f3d2e2d70f358fb2793d7599a (patch)
tree77ad6f5fec2ae4088e5300e1dcaec08167f1d4cb /lib/Matrix
parent6d19d6e43896d84e499020ba0b6f380acdfe7f70 (diff)
downloadperl6-matrix-client-007f12ce41d0331f3d2e2d70f358fb2793d7599a.tar.gz
use TWEAK instead of BUILD
Diffstat (limited to 'lib/Matrix')
-rw-r--r--lib/Matrix/Client/Room.pm611
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Matrix/Client/Room.pm6 b/lib/Matrix/Client/Room.pm6
index 6897b8d..efbca06 100644
--- a/lib/Matrix/Client/Room.pm6
+++ b/lib/Matrix/Client/Room.pm6
@@ -7,17 +7,8 @@ unit class Matrix::Client::Room does Matrix::Client::Requester;
has $!name;
has $.id;
-multi submethod BUILD(Str :$!id!, :$!home-server!, :$!access-token!, :$json?) {
+submethod TWEAK {
$!url-prefix = "/rooms/$!id";
-
- if so $json {
- my @events = $json<state><events>.clone;
- for @events -> $ev {
- if $ev<type> eq "m.room.name" {
- $!name = $ev<content><name>;
- }
- }
- }
}
method !get-name() {