aboutsummaryrefslogtreecommitdiff
path: root/lib/Matrix/Response.pm6
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2019-08-17 19:54:09 -0300
committerMatias Linares <matiaslina@gmail.com>2019-08-17 19:54:09 -0300
commit5feee914510dd9adfa53dce89b160ee2d0218fc0 (patch)
tree0bdef8fae4f5ae7cefe6848faf1a789707c78748 /lib/Matrix/Response.pm6
parentbc6c791c72f9fe460fdb9559522ae154124e8e97 (diff)
parentec4393cb81952fffa2273e313818a57c9611c5a2 (diff)
downloadperl6-matrix-client-5feee914510dd9adfa53dce89b160ee2d0218fc0.tar.gz
Merge branch 'master' into documentation
Diffstat (limited to 'lib/Matrix/Response.pm6')
-rw-r--r--lib/Matrix/Response.pm619
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/Matrix/Response.pm6 b/lib/Matrix/Response.pm6
index edd4d51..268be84 100644
--- a/lib/Matrix/Response.pm6
+++ b/lib/Matrix/Response.pm6
@@ -1,4 +1,4 @@
-use JSON::Tiny;
+use JSON::Fast;
unit module Matrix::Response;
@@ -69,7 +69,7 @@ class Matrix::Response::Sync {
my Matrix::Response::Event @presence;
my Matrix::Response::RoomInfo @joined-rooms;
my Matrix::Response::InviteInfo @invited-rooms;
-
+
for $json<presence><events>.List -> $ev {
@presence.push(Matrix::Response::Event.new(|$ev));
}
@@ -122,3 +122,18 @@ class Tag {
self.bless(:@tags)
}
}
+
+
+class Matrix::Response::Device {
+ has Str $.device-id;
+ has $.display-name;
+ has $.last-seen-ip;
+ has $.last-seen-ts;
+
+ submethod BUILD(
+ Str :device_id(:$!device-id),
+ :display_name(:$!display-name)?,
+ :last_seen_ip(:$!last-seen-ip)?,
+ :last_seen_ts(:$!last-seen-ts)?
+ ) { }
+}