Skip to content

Commit 28c2c72

Browse files
committed
Gerar Wuid no SendContact
1 parent 40c230c commit 28c2c72

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/validate/validate.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ export const contactMessageSchema: JSONSchema7 = {
398398
email: { type: 'string' },
399399
url: { type: 'string' },
400400
},
401-
required: ['fullName', 'wuid', 'phoneNumber'],
401+
required: ['fullName', 'phoneNumber'],
402402
...isNotEmpty('fullName'),
403403
},
404404
minItems: 1,

src/whatsapp/services/whatsapp.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,11 @@ export class WAStartupService {
21252125
result += `URL:${contact.url}\n`;
21262126
}
21272127

2128+
if (!contact.wuid) {
2129+
this.logger.verbose('Wuid defined');
2130+
contact.wuid = this.createJid(contact.phoneNumber);
2131+
}
2132+
21282133
result +=
21292134
`item1.TEL;waid=${contact.wuid}:${contact.phoneNumber}\n` +
21302135
'item1.X-ABLabel:Celular\n' +

0 commit comments

Comments
 (0)