Skip to content

Commit

Permalink
Gerar Wuid no SendContact
Browse files Browse the repository at this point in the history
  • Loading branch information
moskoweb committed Jul 24, 2023
1 parent 40c230c commit 28c2c72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/validate/validate.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export const contactMessageSchema: JSONSchema7 = {
email: { type: 'string' },
url: { type: 'string' },
},
required: ['fullName', 'wuid', 'phoneNumber'],
required: ['fullName', 'phoneNumber'],
...isNotEmpty('fullName'),
},
minItems: 1,
Expand Down
5 changes: 5 additions & 0 deletions src/whatsapp/services/whatsapp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,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' +
Expand Down

0 comments on commit 28c2c72

Please sign in to comment.