mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: presence event when contact not exists
This commit is contained in:
@@ -25,7 +25,7 @@ export class WAConnection extends Base {
|
||||
|
||||
const jid = whatsappID(update.id)
|
||||
const contact = this.contacts[jid]
|
||||
if (jid.endsWith('@s.whatsapp.net')) { // if its a single chat
|
||||
if (contact && jid.endsWith('@s.whatsapp.net')) { // if its a single chat
|
||||
if (update.t) contact.lastSeen = +update.t
|
||||
else if (update.type === Presence.unavailable && contact.lastKnownPresence !== Presence.unavailable) {
|
||||
contact.lastSeen = unixTimestampSeconds()
|
||||
|
||||
Reference in New Issue
Block a user