Net::Async::Matrix::Room - a single Matrix room
Net::Async::Matrix::Room
An instances in this class are used by Net::Async::Matrix to represent a single Matrix room.
The following events are invoked, either using subclass methods or CODE references in parameters:
CODE
Invoked on receipt of a new message from the given member.
Invoked when a member of the room changes state somehow. The $member object will already be in the new state. %changes will be a key/value list of state fields names that were changed, and references to 2-element ARRAYs containing the old and new values for this field.
$member
%changes
Returns the opaque room ID string for the room. Usually this would not be required, except for long-term persistence uniqueness purposes, or for inclusion in direct protocol URLs.
Returns a list of member structs containing the currently known members of the room, in no particular order.
Sends a new message to the room. Requires a type named argument giving the message type. Depending on the type, further keys will be required that specify the message contents:
type
Require body
body
Require url
url
Require geo_uri
geo_uri
A convenient shortcut to sending an text message with a body string and no additional content.
text
Parameters documented as $member receive a membership struct, which supports the following methods:
User ID of the member.
Profile displayname of the user.
Membership state. One of invite or join.
invite
join
Presence state. One of offline, unavailable or online.
offline
unavailable
online
Epoch time that the presence state last changed.
Paul Evans <leonerd@leonerd.org.uk>
To install Net::Async::Matrix, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Async::Matrix
CPAN shell
perl -MCPAN -e shell install Net::Async::Matrix
For more information on module installation, please visit the detailed CPAN module installation guide.