history: fortify contact data

This commit is contained in:
Rajeh Taher
2026-01-22 14:13:33 +02:00
parent c81c074dbd
commit d4e5b4167d
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -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 || '',
+2 -2
View File
@@ -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
})