Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle groups of VCards correctly #99

Merged
merged 2 commits into from
Jun 8, 2024
Merged

Handle groups of VCards correctly #99

merged 2 commits into from
Jun 8, 2024

Conversation

jonx
Copy link

@jonx jonx commented May 3, 2024

A VCard in a message can sometimes be a group of VCards in which case ZVCARDNAME contains a list of VCard names separated by "_$!<Name-Separator>!$_". Note that the first element is the name of the group and is currently dismissed.
ZVCARDSTRING contain the list of VCards separated by "_$!<VCard-Separator>!$_".

Currently the program crashes because it tries to create a Vcard named using a potentially ultra long name (I have groups of hundreds of VCards). This code now handles those groups correctly and saves each VCard in its own VCF file.

You might wanna adjust the content of message.data to your liking as it currently just provide a basic list of the VCards:
"Contact 1 (See file: Contact1.vcf) + Contact 2 (See file: Contact2.vcf)".

Given the path to the VCard can be quite long, I thought you might want to use my format and create a URL link to the actual VCard?

Here is an example:
‎ZVCARDNAME =
2 contacts_$!<Name-Separator>!$_Contact 1_$!<Name-Separator>!$_Contact 2
ZVCARDSTRING =

BEGIN:VCARD
VERSION:3.0
N:Contact;1;;;
FN:Contact 1
TEL;type=CELL;type=VOICE;waid=11231231234:+1 (123) 123-1234
END:VCARD_$!<VCard-Separator>!$_BEGIN:VCARD
VERSION:3.0
N:Contact;1;;;
FN:Contact 2
ORG:Conty;
TEL;type=CELL;type=VOICE;waid=11231231234:+1 (123) 123-1234
item1.ADR;type=HOME:;;1234 Test Ct.;NYC;NY;Blah;United States
item1.X-ABADR:us
END:VCARD

@KnugiHK KnugiHK self-requested a review May 3, 2024 01:18
@KnugiHK KnugiHK added the bug Something isn't working label May 3, 2024
Copy link
Owner

@KnugiHK KnugiHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KnugiHK
Copy link
Owner

KnugiHK commented Jun 8, 2024

To improve user experience, I added direct links to the vCard files, allowing users to download them with a simple click instead of searching for the files themselves.

@KnugiHK KnugiHK merged commit baa79a7 into KnugiHK:dev Jun 8, 2024
@KnugiHK
Copy link
Owner

KnugiHK commented Jun 8, 2024

Thanks for your contribution!

@KnugiHK KnugiHK linked an issue Jun 8, 2024 that may be closed by this pull request
@jonx
Copy link
Author

jonx commented Jul 1, 2024

Of course, you're welcome. Thanks for creating this great tool.

@jonx jonx deleted the dev branch July 1, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very long vCards filenames
2 participants