Skip to content

Commit 20abdd2

Browse files
fix: Adjusts in createJid to sendContact
Adjusts in createJid to sendContact
2 parents 3ca8ab1 + 28c2c72 commit 20abdd2

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
@@ -399,7 +399,7 @@ export const contactMessageSchema: JSONSchema7 = {
399399
email: { type: 'string' },
400400
url: { type: 'string' },
401401
},
402-
required: ['fullName', 'wuid', 'phoneNumber'],
402+
required: ['fullName', 'phoneNumber'],
403403
...isNotEmpty('fullName'),
404404
},
405405
minItems: 1,

src/whatsapp/services/whatsapp.service.ts

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

2280+
if (!contact.wuid) {
2281+
this.logger.verbose('Wuid defined');
2282+
contact.wuid = this.createJid(contact.phoneNumber);
2283+
}
2284+
22802285
result +=
22812286
`item1.TEL;waid=${contact.wuid}:${contact.phoneNumber}\n` +
22822287
'item1.X-ABLabel:Celular\n' +

0 commit comments

Comments
 (0)