arved / PHP-Push-2-owncloud

PHP-Push-2 with CalDAV/LDAP + CardDAV for owncloud 5
GNU Affero General Public License v3.0
13 stars 4 forks source link

FN-section of VCard #1

Closed arved closed 11 years ago

arved commented 11 years ago

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

magcks commented 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?

arved commented 11 years ago

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).

magcks commented 11 years ago

Okay...

Then my solution (generating a new FN if it doesn't exist) is probably the best.

arved commented 11 years ago

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

magcks commented 11 years ago

Okay, thank you.

magcks commented 11 years ago

I have corrected a small mistake: You've used '\n' instead of "\n".

arved commented 11 years ago

I've only do have a qnap for testing, there it worked perfectly ???

magcks commented 11 years ago

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.