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

Add NICKNAME fallback for VCards without FNs #568

Merged
merged 3 commits into from Jun 24, 2022

Conversation

Evengard
Copy link
Contributor

@Evengard Evengard commented Apr 2, 2022

This is a rare yet possible case (I stumbled upon such VCards in my own Google Account storage) where a NICKNAME is defined on a VCard but no FN. Importing such contacts into Nextcloud (using Sabre/VObject) is a bit of a pain, this attempts to solve it.

This is a rare yet possible case (I stumbled upon such VCards in my own Google Account storage) where a NICKNAME is defined on a VCard but no FN. Importing such contacts into Nextcloud (using Sabre/VObject) is a bit of a pain, this attempts to solve it.
@Evengard
Copy link
Contributor Author

Evengard commented May 6, 2022

Is that project not maintained anymore?...

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

This seems reasonable. If the Formatted Name "FN" is not provided, then we have a "reasonable try" to fill it in by trying to use "N" (Name), "ORG", "NICKNAME", "email" - whichever is found first in that order.

@phil-davis phil-davis merged commit ac49d03 into sabre-io:master Jun 24, 2022
@@ -92,6 +92,14 @@ public function validateData()
],
"BEGIN:VCARD\r\nVERSION:4.0\r\nUID:foo\r\nORG:Acme Co.\r\nFN:Acme Co.\r\nEND:VCARD\r\n",
];
// No FN, NICKNAME fallback
$tests[] = [
"BEGIN:VCARD\r\nVERSION:4.0\r\nUID:foo\r\NICKNAME:JohnDoe\r\nEND:VCARD\r\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: CI did not run in this PR. This line was missing an "n"
UID:foo\r\NICKNAME:JohnDoe needs to be UID:foo\r\nNICKNAME:JohnDoe

Fixed in #576

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.

None yet

2 participants