diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2018-06-03 12:36:49 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2018-06-03 12:36:49 -0300 |
commit | 0b3314ab4af32ac3e2169cbcbc24ae1a450a6f45 (patch) | |
tree | f9cb5a88aa548fd3054d77a693f10c39a0992aa8 /lib/Matrix/Response.pm6 | |
parent | 1e3e664d19f4808baeecc72784610daef76730bc (diff) | |
download | perl6-matrix-client-0b3314ab4af32ac3e2169cbcbc24ae1a450a6f45.tar.gz |
Add room-id to StateEvents
Diffstat (limited to 'lib/Matrix/Response.pm6')
-rw-r--r-- | lib/Matrix/Response.pm6 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Matrix/Response.pm6 b/lib/Matrix/Response.pm6 index f51314b..57417b7 100644 --- a/lib/Matrix/Response.pm6 +++ b/lib/Matrix/Response.pm6 @@ -48,9 +48,9 @@ class Matrix::Response::InviteInfo { } } -sub gather-events($from) { +sub gather-events($room-id, $from) { gather for $from<events>.List -> $ev { - take Matrix::Response::StateEvent.new(|$ev); + take Matrix::Response::StateEvent.new(:room_id($room-id), |$ev); } } @@ -75,12 +75,12 @@ class Matrix::Response::Sync { } for $json<rooms><join>.kv -> $room-id, $data { - my @state = gather-events($data<state>); + my @state = gather-events($room-id, $data<state>); my $timeline = Matrix::Response::Timeline.new( limited => $data<timeline><limited>, prev-batch => $data<timeline><prev_batch>, - events => gather-events($data<timeline>) + events => gather-events($room-id, $data<timeline>) ); @joined-rooms.push(Matrix::Response::RoomInfo.new( @@ -89,7 +89,7 @@ class Matrix::Response::Sync { } for $json<rooms><invite>.kv -> $room-id, $data { - my @events = gather-events($data<invite_state>); + my @events = gather-events($room-id, $data<invite_state>); @invited-rooms.push(Matrix::Response::InviteInfo.new( :$room-id, :@events )); |