mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-15 11:42:53 -06:00
added organization name in vcard
This commit is contained in:
parent
964427e533
commit
a5e29758a4
@ -379,6 +379,7 @@ export const contactMessageSchema: JSONSchema7 = {
|
|||||||
description: '"wuid" must be a numeric string',
|
description: '"wuid" must be a numeric string',
|
||||||
},
|
},
|
||||||
phoneNumber: { type: 'string', minLength: 10 },
|
phoneNumber: { type: 'string', minLength: 10 },
|
||||||
|
organization: { type: 'string' },
|
||||||
},
|
},
|
||||||
required: ['fullName', 'wuid', 'phoneNumber'],
|
required: ['fullName', 'wuid', 'phoneNumber'],
|
||||||
...isNotEmpty('fullName'),
|
...isNotEmpty('fullName'),
|
||||||
|
@ -125,6 +125,7 @@ export class ContactMessage {
|
|||||||
fullName: string;
|
fullName: string;
|
||||||
wuid: string;
|
wuid: string;
|
||||||
phoneNumber: string;
|
phoneNumber: string;
|
||||||
|
organization?: string;
|
||||||
}
|
}
|
||||||
export class SendContactDto extends Metadata {
|
export class SendContactDto extends Metadata {
|
||||||
contactMessage: ContactMessage[];
|
contactMessage: ContactMessage[];
|
||||||
|
@ -1425,20 +1425,15 @@ export class WAStartupService {
|
|||||||
const message: proto.IMessage = {};
|
const message: proto.IMessage = {};
|
||||||
|
|
||||||
const vcard = (contact: ContactMessage) => {
|
const vcard = (contact: ContactMessage) => {
|
||||||
return (
|
const result =
|
||||||
'BEGIN:VCARD\n' +
|
'BEGIN:VCARD\n' +
|
||||||
'VERSION:3.0\n' +
|
'VERSION:3.0\n' +
|
||||||
'FN:' +
|
`FN:${contact.fullName}\n` +
|
||||||
contact.fullName +
|
`ORG:${contact.organization};\n` +
|
||||||
'\n' +
|
`TEL;type=CELL;type=VOICE;waid=${contact.wuid}:${contact.wuid}\n` +
|
||||||
'item1.TEL;waid=' +
|
'END:VCARD';
|
||||||
contact.wuid +
|
|
||||||
':' +
|
return result;
|
||||||
contact.phoneNumber +
|
|
||||||
'\n' +
|
|
||||||
'item1.X-ABLabel:Celular\n' +
|
|
||||||
'END:VCARD'
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data.contactMessage.length === 1) {
|
if (data.contactMessage.length === 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user