jens-maus / carddav2fb

:notebook: A command-line PHP script allowing to import CardDAV-based VCards (e.g. from 'owncloud') to a phonebook in a AVM FRITZ!Box
The Unlicense
28 stars 19 forks source link

Fallback to formatted name if available #34

Closed Fensterbank closed 8 years ago

Fensterbank commented 8 years ago

I installed a brand new version of owncloud and created some new contacts in the web UI. The script could not determine the contact names.

The RAW data of an example vcard looked like this.

BEGIN:VCARD
VERSION:3.0
FN:Mike Kunze
UID:bc44600d-ff0f-4400-89b1-518e39d6a0d8
TEL;TYPE=HOME\,VOICE:06439 69 75 74
END:VCARD

No name property was included, but there is a formatted name. I think this is the default behavior when a contact is created directly in the web application.

In this pull request a fallback to the formatted name is done, if no name could be determined and formatted name is available. Also a new line is added to the warning message.