Closed arved closed 11 years ago
It is possible that this is an issue of ownCloud. Because the vcard seems to be correct: BEGIN:VCARD VERSION:3.0 PRODID:Z-Push N:xxxxx;xxxx TEL;TYPE=CELL:+49 xxxx CATEGORIES:TU-Darmstadt
We doesn't send "FN" to owncloud so it shound keep the old FN-value.
So a solution would be to fetch the old value (at PHP-Push-2-owncloud) and send it back to ownCloud.
Am I right?
I've seen lots of non-compliant behavior of sabredav/owncloud, even on my qnap... There is no update on a field level, the contact is written complete on change. So it's important to have all important values written on both sides, regading multiple devices to sync. The smallest entity in this code is the contact. The original code was developed by ziirish as a part of the z-push contibtution (https://github.com/fmbiete/Z-Push-contrib/issues/1).
Okay...
Then my solution (generating a new FN if it doesn't exist) is probably the best.
already comitted, but I changed it a little to fit the logic acutally introduced in the "vcard bakery", so it's probably easier to read
Okay, thank you.
I have corrected a small mistake: You've used '\n' instead of "\n".
I've only do have a qnap for testing, there it worked perfectly ???
Technically it shouldn't has worked perfectly because '\n' is not the same like "\n". '\n' === "\n". If you use '\n' ownCloud returns crazy results.
I have added some code (probably on the wrong method) to set the FN-section of VCard if it is empty (a better solution would be keeping the old one). This happens (with my phone) if I update the name of a contact. In ownCloud I see a empty string or "{name}" instead of the name ({name} seems to be the ownCloud representation for an empty name).
https://gist.github.com/justbrain/5967587