From 0b3314ab4af32ac3e2169cbcbc24ae1a450a6f45 Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sun, 3 Jun 2018 12:36:49 -0300 Subject: Add room-id to StateEvents --- lib/Matrix/Response.pm6 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') 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.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.kv -> $room-id, $data { - my @state = gather-events($data); + my @state = gather-events($room-id, $data); my $timeline = Matrix::Response::Timeline.new( limited => $data, prev-batch => $data, - events => gather-events($data) + events => gather-events($room-id, $data) ); @joined-rooms.push(Matrix::Response::RoomInfo.new( @@ -89,7 +89,7 @@ class Matrix::Response::Sync { } for $json.kv -> $room-id, $data { - my @events = gather-events($data); + my @events = gather-events($room-id, $data); @invited-rooms.push(Matrix::Response::InviteInfo.new( :$room-id, :@events )); -- cgit v1.2.3-70-g09d2