added pong event

This commit is contained in:
Adhiraj
2020-09-03 22:58:27 +05:30
parent fe0730b6a7
commit 1340279cdb
3 changed files with 6 additions and 1 deletions

View File

@@ -264,6 +264,7 @@ export class WAConnection extends Base {
// when the first character in the message is an '!', the server is updating the last seen
const timestamp = message.slice(1, message.length).toString ('utf-8')
this.lastSeen = new Date(parseInt(timestamp))
this.emit ('received-pong')
} else {
const decrypted = Utils.decryptWA (message, this.authInfo?.macKey, this.authInfo?.encKey, new Decoder())
if (!decrypted) return