summaryrefslogtreecommitdiff
path: root/lib/Matrix/Response.pm6
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2018-06-09 16:43:35 -0300
committerMatias Linares <matiaslina@openmailbox.org>2018-06-09 16:43:35 -0300
commit5611f785dc62d7af68adc3ba9bd2c5199c38d96a (patch)
tree03e37d3ba928ec209c9b23383cae0bbfd31e2320 /lib/Matrix/Response.pm6
parent3968265131adb2f12dfa80f291069d01df4c341a (diff)
downloadperl6-matrix-client-5611f785dc62d7af68adc3ba9bd2c5199c38d96a.tar.gz
Add presence methods.
This adds a way to change and query the presence for users. Closes #4
Diffstat (limited to 'lib/Matrix/Response.pm6')
-rw-r--r--lib/Matrix/Response.pm614
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Matrix/Response.pm6 b/lib/Matrix/Response.pm6
index 57417b7..d8f68f0 100644
--- a/lib/Matrix/Response.pm6
+++ b/lib/Matrix/Response.pm6
@@ -99,3 +99,17 @@ class Matrix::Response::Sync {
:@joined-rooms, :@invited-rooms);
}
}
+
+class Presence {
+ has Str $.presence is required;
+ has Int $.last-active-ago;
+ has Str $.status-message;
+ has Bool $.currently-active;
+
+ submethod BUILD(
+ Str :$!presence,
+ :last_active_ago(:$!last-active-ago) = 0,
+ :status_message(:$!status-message) = "",
+ :currently_active(:$!currently-active) = False
+ ) { }
+}