Open
Conversation
Fix BDAY date.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
DESCfield used have a getter namedgetNote()because later in the VCard v4 it the DESC was renamed to NOTE. So to minimize code changes on migration I made it calledgetNote(). 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: