Skip to content

VCard fixes and improvements#701

Open
stokito wants to merge 6 commits intoigniterealtime:masterfrom
stokito:vcard-temp
Open

VCard fixes and improvements#701
stokito wants to merge 6 commits intoigniterealtime:masterfrom
stokito:vcard-temp

Conversation

@stokito
Copy link
Member

@stokito stokito commented Mar 1, 2026

The VCard is not easy to use because we have to call the getField("SOMETHING") method. I added getters to simplify this i.e. getSomething().
I added getter only for those fields that are in XEP. The DESC field used have a getter named getNote() because later in the VCard v4 it the DESC was renamed to NOTE. So to minimize code changes on migration I made it called getNote(). I guess the same VCard class will be used once the VCard v4 will be used. BTW the Prosody sets the <NOTE> field, not the <DESC> and that was confusing for me. I'll report this to them.

Also I noticed a problem that the Address Extended field wasn't properly named: it was EXTADR but should be EXTADD as in XEP (and Tigease). This change breaks old VCards with the EXTADR field but I'm pretty sure that no one IRL used it.

And last change is for the Full Name (FN): it shouldn't be auto generated from first and last names but a user may specify it according to their locale (e.g. Family name + Given name). The backward compatibility is preserved.

Links:

stokito added 6 commits March 1, 2026 22:57
According to XEP the extended address should be EXTADD but not the EXTADR
Instead of getField("FN") clients should use the getFullName().
For the DESC field the getter is called getNote() because later in VCard v4 it was renamed to NOTE.
The FN field is generated from firstName + lastName but it may be different. In addition to generating it we can keep the original FN value on parsing and also allow specifying it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant