Move msgCount increment to generateMessageTag

Prevents duplicate tags from being sent
This commit is contained in:
Adhiraj Singh
2021-01-24 17:25:49 +05:30
parent e1952ff349
commit 63dd136afa
4 changed files with 28 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ import * as fs from 'fs'
async function example() {
const conn = new WAConnection() // instantiate
conn.autoReconnect = ReconnectMode.onConnectionLost // only automatically reconnect when the connection breaks
conn.logger.level = 'trace' // set to 'debug' to see what kind of stuff you can implement
conn.logger.level = 'debug' // set to 'debug' to see what kind of stuff you can implement
// attempt to reconnect at most 10 times in a row
conn.connectOptions.maxRetries = 10
conn.chatOrderingKey = waChatKey(true) // order chats such that pinned chats are on top
@@ -38,7 +38,6 @@ async function example() {
fs.writeFileSync('./auth_info.json', JSON.stringify(authInfo, null, '\t')) // save this info to a file
console.log('oh hello ' + conn.user.name + ' (' + conn.user.jid + ')')
// uncomment to load all unread messages
//const unread = await conn.loadAllUnreadMessages ()
//console.log ('you have ' + unread.length + ' unread messages')