fix: Adjusts in createJid to sendContact

Adjusts in createJid to sendContact
This commit is contained in:
Davidson Gomes 2023-07-24 11:17:35 -03:00 committed by GitHub
commit 20abdd2908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -399,7 +399,7 @@ export const contactMessageSchema: JSONSchema7 = {
email: { type: 'string' },
url: { type: 'string' },
},
required: ['fullName', 'wuid', 'phoneNumber'],
required: ['fullName', 'phoneNumber'],
...isNotEmpty('fullName'),
},
minItems: 1,

View File

@ -2277,6 +2277,11 @@ export class WAStartupService {
result += `URL:${contact.url}\n`;
}
if (!contact.wuid) {
this.logger.verbose('Wuid defined');
contact.wuid = this.createJid(contact.phoneNumber);
}
result +=
`item1.TEL;waid=${contact.wuid}:${contact.phoneNumber}\n` +
'item1.X-ABLabel:Celular\n' +