fix(whatsapp): normalize device-qualified contact ids

This commit is contained in:
wmq
2026-08-03 01:11:46 +08:00
parent 7e739ad7b8
commit bffd2f4fe6
3 changed files with 11 additions and 3 deletions
+2
View File
@@ -805,6 +805,7 @@ async function connectAccount(accountId) {
id: jidNormalizedUser(sock.user.id),
name: sock.user.name || account.name || account.phoneNumber,
} : account.user
delete account.lastError
delete account.qrDataUrl
delete account.pairingCode
const session = sessions.get(accountId)
@@ -1595,6 +1596,7 @@ app.get('/accounts/:id/chats/:jid/identity', async (req, res) => {
phoneJid = jid
}
}
phoneJid = jidNormalizedUser(phoneJid)
const contact = store.contacts.get(jid) || store.contacts.get(phoneJid) || {}
const group = jid.endsWith('@g.us')
? await sock.groupMetadata(jid).catch(() => store.groups.get(jid))