aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2018-06-03 12:36:49 -0300
committerMatias Linares <matiaslina@openmailbox.org>2018-06-03 12:36:49 -0300
commit0b3314ab4af32ac3e2169cbcbc24ae1a450a6f45 (patch)
treef9cb5a88aa548fd3054d77a693f10c39a0992aa8
parent1e3e664d19f4808baeecc72784610daef76730bc (diff)
downloadperl6-matrix-client-0b3314ab4af32ac3e2169cbcbc24ae1a450a6f45.tar.gz
Add room-id to StateEvents
-rw-r--r--lib/Matrix/Response.pm610
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
));