]> err.no Git - sope/commitdiff
improved vCard type handling
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Tue, 31 May 2005 11:39:05 +0000 (11:39 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Tue, 31 May 2005 11:39:05 +0000 (11:39 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@815 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-ical/NGiCal/ChangeLog
sope-ical/NGiCal/NGVCardSaxHandler.m
sope-ical/NGiCal/Version

index b71bc0be782cdc5c83afabcbbe5b6deb79dfe8ff..b41419286bd020c9c7d77ac9358b2af63ea40de5 100644 (file)
@@ -1,3 +1,8 @@
+2005-05-31  Helge Hess  <helge.hess@skyrix.com>
+
+       * NGVCardSaxHandler.m: ensure that types are always uppercase, improved
+         check for DUPs (v4.5.46)
+
 2005-05-16  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * NGiCal.xcode: reorganized ordering of headers/classes
index b169e2ed3933ce7150fa994c5d92685ec18391b5..239ae8bcbf508b2cd2ed080fef1e01ebcf914292 100644 (file)
     v = [_attrs valueAtIndex:i];
     
     if ([n hasSuffix:@".type"] || [n isEqualToString:@"TYPE"]) {
-      if (![self->types containsObject:v]) 
-       [self->types addObjectsFromArray:[v componentsSeparatedByString:@" "]];
+      /*
+        Note: types cannot be separated by comma! Its indeed always a space,eg
+                "work pref voice"
+              If you find commas, usually the vCard is broken.
+      */
+      NSEnumerator *e;
+      NSString *k;
+      
+      e = [[v componentsSeparatedByString:@" "] objectEnumerator];
+      while ((k = [e nextObject]) != nil) {
+        k = [k uppercaseString];
+        if ([self->types containsObject:k]) continue;
+       [self->types addObject:k];
+      }
     }
     else
       [self->args setObject:v forKey:n];
index 632bc18a75a13f21bc93737a638b8b47a97ee5b7..2473f5b6cbfe86d24bc491961bb799330bba62db 100644 (file)
@@ -2,7 +2,7 @@
 
 MAJOR_VERSION=4
 MINOR_VERSION=5
-SUBMINOR_VERSION:=54
+SUBMINOR_VERSION:=56
 
 # v4.5.40 requires NGExtensions v4.5.145
 # v4.5.37 requires NGExtensions v4.5.140