diff --git a/src/Utils/chat-utils.ts b/src/Utils/chat-utils.ts index 04cd8547..0b8787de 100644 --- a/src/Utils/chat-utils.ts +++ b/src/Utils/chat-utils.ts @@ -930,7 +930,11 @@ export const processSyncAction = ( ev.emit('contacts.upsert', [ { id: id!, - name: action.lidContactAction.fullName || undefined, + name: + action.lidContactAction.fullName || + action.lidContactAction.firstName || + action.lidContactAction.username || + undefined, lid: id!, phoneNumber: undefined } diff --git a/src/Utils/sync-action-utils.ts b/src/Utils/sync-action-utils.ts index d53b00fb..14ecd310 100644 --- a/src/Utils/sync-action-utils.ts +++ b/src/Utils/sync-action-utils.ts @@ -45,7 +45,7 @@ export const processContactAction = ( data: [ { id, - name: action.fullName || undefined, + name: action.fullName || action.firstName || action.username || undefined, lid: lidJid || undefined, phoneNumber } diff --git a/src/__tests__/Utils/sync-action-utils.test.ts b/src/__tests__/Utils/sync-action-utils.test.ts index 5c19d29e..fbf54303 100644 --- a/src/__tests__/Utils/sync-action-utils.test.ts +++ b/src/__tests__/Utils/sync-action-utils.test.ts @@ -2,7 +2,6 @@ import { jest } from '@jest/globals' import type { ILogger } from '../../Utils/logger' import { processContactAction } from '../../Utils/sync-action-utils' - describe('processContactAction', () => { const mockLogger: ILogger = { warn: jest.fn(),