Fix category handling from AS messages, use a GUID for uid, not a random id
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 14 Aug 2010 17:44:48 +0000 (13:44 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 14 Aug 2010 17:44:48 +0000 (13:44 -0400)
turba/lib/Driver.php

index 153e09f..062851b 100644 (file)
@@ -789,7 +789,7 @@ class Turba_Driver
         }
 
         if (!isset($attributes['__uid'])) {
-            $attributes['__uid'] = strval(new Horde_Support_Randomid());
+            $attributes['__uid'] = strval(new Horde_Support_Guid());
         }
 
         $key = $attributes['__key'] = $this->_makeKey($this->toDriverKeys($attributes));
@@ -2497,10 +2497,9 @@ class Turba_Driver
 
         /* Categories */
         if (count($message->categories)) {
-            $hash['category']['value'] = Horde_String::convertCharset(implode(';', $message->categories), 'utf-8', $charset);
-            $hash['category']['new'] = true;
+            $hash['category'] = Horde_String::convertCharset(implode('|', $message->categories), 'utf-8', $charset);
         } elseif (!$message->isGhosted('categories')) {
-            $hash['category']['value'] = '';
+            $hash['category'] = '';
         }
 
         /* Birthday and Anniversary */