Completely remove message-status-update & user-status-update

This commit is contained in:
Adhiraj Singh
2021-01-04 14:19:44 +05:30
parent ac4b4c7384
commit 6cc5a910f7
7 changed files with 26 additions and 26 deletions

View File

@@ -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)
}
}))

View File

@@ -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)
}
})