From d4e5b4167d0b728376d5537a38d28acf0947c411 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Thu, 22 Jan 2026 14:13:33 +0200 Subject: [PATCH] history: fortify contact data --- src/Socket/messages-recv.ts | 1 + src/Utils/history.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 95957134..decff29c 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -755,6 +755,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 || '', diff --git a/src/Utils/history.ts b/src/Utils/history.ts index b8c1a504..7572940e 100644 --- a/src/Utils/history.ts +++ b/src/Utils/history.ts @@ -45,8 +45,8 @@ export const processHistoryMessage = (item: proto.IHistorySync) => { for (const chat of item.conversations! as Chat[]) { contacts.push({ id: chat.id!, - name: chat.name || undefined, - lid: chat.lidJid || undefined, + name: chat.displayName || chat.name || chat.username || undefined, + lid: chat.lidJid || chat.accountLid || undefined, phoneNumber: chat.pnJid || undefined })