feat: listen to group events (#90)

This allows you to listen for user joins or leaves, description updates, subject updates, picture updates, and group settings updates.

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
Aliyss Snow
2020-03-01 19:32:58 +01:00
committed by GitHub
parent 588dc93c17
commit 48b9ae1e81
4 changed files with 154 additions and 2 deletions

View File

@@ -36,6 +36,9 @@ exports.Events = {
MESSAGE_REVOKED_EVERYONE: 'message_revoke_everyone',
MESSAGE_REVOKED_ME: 'message_revoke_me',
MESSAGE_ACK: 'message_ack',
GROUP_JOIN: 'group_join',
GROUP_LEAVE: 'group_leave',
GROUP_UPDATE: 'group_update',
QR_RECEIVED: 'qr',
DISCONNECTED: 'disconnected',
STATE_CHANGED: 'change_state',
@@ -61,6 +64,23 @@ exports.MessageTypes = {
UNKNOWN: 'unknown'
};
/**
* Group notification types
* @readonly
* @enum {string}
*/
exports.GroupNotificationTypes = {
ADD: 'add',
INVITE: 'invite',
REMOVE: 'remove',
LEAVE: 'leave',
SUBJECT: 'subject',
DESCRIPTION: 'description',
PICTURE: 'picture',
ANNOUNCE: 'announce',
RESTRICT: 'restrict',
};
/**
* Chat types
* @readonly