mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Completely remove message-status-update & user-status-update
This commit is contained in:
@@ -12,9 +12,11 @@ WAConnectionTest('Messages', conn => {
|
||||
it('should send a pending message', async () => {
|
||||
const message = await sendAndRetreiveMessage(conn, 'hello fren', MessageType.text, { waitForAck: false })
|
||||
|
||||
await new Promise(resolve => conn.once('message-status-update', update => {
|
||||
if (update.ids.includes(message.key.id)) {
|
||||
assert.strictEqual(update.type, WA_MESSAGE_STATUS_TYPE.SERVER_ACK)
|
||||
await new Promise(resolve => conn.on('chat-update', update => {
|
||||
if (update.jid === testJid &&
|
||||
update.messages &&
|
||||
update.messages.first.key.id === message.key.id &&
|
||||
update.messages.first.status === WA_MESSAGE_STATUS_TYPE.SERVER_ACK) {
|
||||
resolve(undefined)
|
||||
}
|
||||
}))
|
||||
|
||||
@@ -21,10 +21,10 @@ WAConnectionTest('Misc', conn => {
|
||||
const newStatus = 'v cool status'
|
||||
|
||||
const waitForEvent = new Promise (resolve => {
|
||||
conn.on ('user-status-update', ({jid, status}) => {
|
||||
conn.on ('contact-update', ({jid, status}) => {
|
||||
if (jid === conn.user.jid) {
|
||||
assert.strictEqual (status, newStatus)
|
||||
conn.removeAllListeners ('user-status-update')
|
||||
conn.removeAllListeners ('contact-update')
|
||||
resolve(undefined)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user