whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

fix(vcard): parse vcard module

Open CyrilLacroix opened this issue 2 years ago • 21 comments

PR Details

Fix for vCard parsing.

Description

Modules and their function that are responsible for parsing vCards were updated.

Related Issues

closes #1994 closes #2680

Motivation and Context

The vCard was not display, the content of the vCard was sent to Whatsapp chat.

How Has This Been Tested

Tested with a Bot, the vCard is now generated and displayed properly in Whatsapp.

// client initialization...

client.on('ready', async () => {
    const userId = '[email protected]';
    const vCard =
        'BEGIN:VCARD\n' +
        'VERSION:3.0\n' +
        'FN:John Doe\n' +
        'ORG:Microsoft;\n' +
        'TEL;type=CELL;type=VOICE;waid=18006427676:+1 (800) 642 7676\n' +
        'END:VCARD';
    await client.sendMessage(userId, vCard);
});

Types of changes

  • [ ] Dependency change
  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [X] My code follows the code style of this project.
  • [ ] I have updated the documentation accordingly (index.d.ts).

CyrilLacroix avatar Feb 12 '23 14:02 CyrilLacroix

#1994

tofers avatar Feb 12 '23 17:02 tofers

closes #1994

purpshell avatar Feb 13 '23 15:02 purpshell

thanks

RC047 avatar Feb 14 '23 10:02 RC047

Should this be working with multiple cards?

nathanfinger avatar Mar 02 '23 19:03 nathanfinger

Remove all formatting changes

purpshell avatar Jun 02 '23 19:06 purpshell

@CyrilLacroix

Installing npm install git+https://github.com/CyrilLacroix/whatsapp-web.js.git

get a

TypeError: data.id.id.substring is not a function

When is it going to be merge to master?

frnndwrms avatar Jun 05 '23 15:06 frnndwrms

Where we standing with this?

shirser121 avatar Aug 07 '23 20:08 shirser121

When this pull merge it? It works flawlessly @PurpShell @tuyuribr @shirser121

RC047 avatar Aug 12 '23 13:08 RC047

@alechkos

RC047 avatar Dec 12 '23 07:12 RC047

I tested its work

Didn´t work to me

joweste avatar Dec 22 '23 16:12 joweste

I tested the change and confirm that it fixes the problem.

khsoh avatar Jan 17 '24 01:01 khsoh

vcardGetNameFromParsed is no longer usable, I have switched to parsed.N[0].value.join(' ').trim()

aksiuwaa avatar Jan 25 '24 05:01 aksiuwaa

vcardGetNameFromParsed is no longer usable, I have switched to parsed.N[0].value.join(' ').trim()

Can you share all the code changes need to be placed?

RemyBoy72 avatar Feb 10 '24 09:02 RemyBoy72

vcardGetNameFromParsed is no longer usable, I have switched to parsed.N[0].value.join(' ').trim()

Can you share all the code changes need to be placed?

videjunior avatar Feb 10 '24 22:02 videjunior

src/util/Injected.js in line 270: const parsed = window.Store.VCardParse.parseVcard(content); if (parsed) { vcardOptions = { type: 'vcard', vcardFormattedName: parsed.N[0].value.join(' ').trim() }; }

aksiuwaa avatar Feb 12 '24 06:02 aksiuwaa

src/util/Injected.js in line 270: const parsed = window.Store.VCardParse.parseVcard(content); if (parsed) { vcardOptions = { type: 'vcard', vcardFormattedName: parsed.N[0].value.join(' ').trim() }; }

thx but it still doesnt work at least for me. any other way to rectify the issue?

RemyBoy72 avatar Feb 12 '24 17:02 RemyBoy72

how do I solve this, please explain what needs to be replaced.

raisa875647 avatar Feb 14 '24 00:02 raisa875647

any ETA on this?

poislagarde avatar Jul 19 '24 21:07 poislagarde