Deprecated message-new & message-update + fix presence update for groups

The chat-update event is fired now when a message is received/updated
This commit is contained in:
Adhiraj Singh
2020-11-13 16:07:08 +05:30
parent eaf56f6d71
commit eace0c1795
6 changed files with 59 additions and 39 deletions

View File

@@ -182,6 +182,8 @@ Also, these events are fired regardless of whether they are initiated by the Bai
on (event: 'open', listener: (result: WAOpenResult) => void): this
/** when the connection is opening */
on (event: 'connecting', listener: () => void): this
/** when the connection has been validated */
on (event: 'connection-validated', listener: (user: WAUser) => void): this
/** when the connection has closed */
on (event: 'close', listener: (err: {reason?: DisconnectReason | string, isReconnecting: boolean}) => void): this
/** when the socket is closed */
@@ -198,12 +200,8 @@ on (event: 'user-presence-update', listener: (update: PresenceUpdate) => void):
on (event: 'user-status-update', listener: (update: {jid: string, status?: string}) => void): this
/** when a new chat is added */
on (event: 'chat-new', listener: (chat: WAChat) => void): this
/** when a chat is updated (archived, deleted, pinned) */
on (event: 'chat-update', listener: (chat: Partial<WAChat> & { jid: string }) => void): this
/** when a new message is relayed */
on (event: 'message-new', listener: (message: WAMessage) => void): this
/** when a message object itself is updated (receives its media info or is deleted) */
on (event: 'message-update', listener: (message: WAMessage) => void): this
/** when a chat is updated (new message, updated message, deleted, pinned, etc) */
on (event: 'chat-update', listener: (chat: WAChatUpdate) => void): this
/** when a message's status is updated (deleted, delivered, read, sent etc.) */
on (event: 'message-status-update', listener: (message: WAMessageStatusUpdate) => void): this
/** when participants are added to a group */