[sync] spouse, children, anniversary entries

David Hoover spm at boiteauxlettres.sent.at
Mon Mar 9 22:09:29 UTC 2009


Hi,

I noticed that the vCard code internally uses 'X-SYNCJE-ANNIVERSARY',
'X-SYNCJE-SPOUSE', and 'X-SYNCJE-CHILD' vCard property names.  These are
product-specific, and I noticed that there are different variations on
these like X-EVOLUTION-SPOUSE, X-EVOLUTION-ANNIVERSARY,
X-FUNAMBOL-SPOUSE.

The wikipedia vCard page mentions the more neutral X-ANNIVERSARY and
X-SPOUSE property names, and I noticed that my Nokia E51 uses them, as
well as X-ASSISTANT and X-ASSISTANT-TEL.

Wouldn't it be better for horde to internally use these generic names,
instead of product-specific ones? Driver code could do conversion if
necessary for specific devices.

After making the following changes, my Nokia syncs Spouse and Children
correctly. I don't think these changes will break the Sync4j
synchronization, since the use of X-SYNCJE-* appears to be
horde-internal, but exported vCards will be more "neutral", which is
probably good in the long run.

Regards,

David Hoover.


--- lib/Horde/iCalendar.php.dho 2009-03-09 19:41:47.000000000 +0000
+++ lib/Horde/iCalendar.php     2009-03-09 19:42:31.000000000 +0000
@@ -651,7 +651,7 @@
                     break;
 
                 case 'BDAY':
-                case 'X-SYNCJE-ANNIVERSARY':
+                case 'X-ANNIVERSARY':
                     $this->setAttribute($tag,
                     $this->_parseDate($value), $params);
                     break;
 
--- lib/SyncML/Device/Sync4j.php.dho    2009-03-09 19:41:29.000000000
+0000
+++ lib/SyncML/Device/Sync4j.php        2009-03-09 19:43:10.000000000
+0000
@@ -265,9 +265,9 @@
             'Birthday' => array('BDAY'),
             'Categories' => array('CATEGORIES'),
             'Timezone' => array('TZ'),
-            'Anniversary' => array('X-SYNCJE-ANNIVERSARY'),
-            'Spouse' => array('X-SYNCJE-SPOUSE'),
-            'Children' => array('X-SYNCJE-CHILD'),
+            'Anniversary' => array('X-ANNIVERSARY'),
+            'Spouse' => array('X-SPOUSE'),
+            'Children' => array('X-CHILDREN'),
         );
         foreach ($map as $sif_value => $vcard_value) {
             if (isset($a[$sif_value])) {
@@ -759,7 +759,7 @@
                 }
                 break;
 
-            case 'X-SYNCJE-ANNIVERSARY':
+            case 'X-ANNIVERSARY':
                 if (is_array($item['value'])) {
                     $hash['Anniversary'] = sprintf('%04d-%02d-%02d',
                                                 $item['value']['year'],
@@ -768,11 +768,11 @@
                 }
                 break;
 
-            case 'X-SYNCJE-SPOUSE':
+            case 'X-SPOUSE':
                 $hash['Spouse'] = $item['value'];
                 break;
 
-            case 'X-SYNCJE-CHILD':
+            case 'X-CHILDREN':
                 $hash['Children'] = $item['value'];
                 break;
 
--- turba/lib/Driver.php.dho    2009-03-09 19:41:09.000000000 +0000
+++ turba/lib/Driver.php        2009-03-09 19:43:39.000000000 +0000
@@ -1163,15 +1163,15 @@
                 break;
 
             case 'anniversary':
-                $vcard->setAttribute('X-SYNCJE-ANNIVERSARY', $val);
+                $vcard->setAttribute('X-ANNIVERSARY', $val);
                 break;
 
             case 'spouse':
-                $vcard->setAttribute('X-SYNCJE-SPOUSE', $val);
+                $vcard->setAttribute('X-SPOUSE', $val);
                 break;
 
             case 'children':
-                $vcard->setAttribute('X-SYNCJE-CHILD', $val);
+                $vcard->setAttribute('X-CHILDREN', $val);
                 break;
 
             case 'website':
@@ -1835,15 +1835,15 @@
                 $hash['instantMessenger'] = $item['value'];
                 break;
 
-            case 'X-SYNCJE-ANNIVERSARY':
+            case 'X-ANNIVERSARY':
                 $hash['anniversary'] = $item['value']['year'] . '-' .
                 $item['value']['month'] . '-' . 
                 $item['value']['mday'];
                 break;
 
-            case 'X-SYNCJE-CHILD':
+            case 'X-CHILDREN':
                 $hash['children'] = $item['value'];
                 break;
 
-            case 'X-SYNCJE-SPOUSE':
+            case 'X-SPOUSE':
                 $hash['spouse'] = $item['value'];
                 break;
             }


More information about the sync mailing list