feat(history): fortify contact data extraction with fallbacks
- Add fallback chain for contact name: displayName || name || username - Add fallback for LID: lidJid || accountLid - Add TODO marker for WAJIDHASH support in picture updates These fallbacks improve robustness when WhatsApp returns contact data in different fields depending on account type (business, personal).
This commit is contained in:
@@ -765,6 +765,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
const setPicture = getBinaryNodeChild(node, 'set')
|
||||
const delPicture = getBinaryNodeChild(node, 'delete')
|
||||
|
||||
// TODO: WAJIDHASH stuff proper support inhouse
|
||||
ev.emit('contacts.update', [
|
||||
{
|
||||
id: jidNormalizedUser(node?.attrs?.from) || (setPicture || delPicture)?.attrs?.hash || '',
|
||||
|
||||
Reference in New Issue
Block a user