]> err.no Git - sope/blobdiff - sope-ical/NGiCal/iCalPerson.m
added class version checks
[sope] / sope-ical / NGiCal / iCalPerson.m
index 888c92be25999f0c385e43052c8e46bdbbe7d0dd..2069d084726072201029a80409c5488c165c29b7 100644 (file)
 
 @implementation iCalPerson
 
++ (int)version {
+  return [super version] + 0 /* v0 */;
+}
++ (void)initialize {
+  NSAssert2([super version] == 0,
+            @"invalid superclass (%@) version %i !",
+            NSStringFromClass([self superclass]), [super version]);
+}
+
 - (void)dealloc {
   [self->cn       release];
   [self->email    release];
   [super dealloc];
 }
 
+/* NSCopying */
+
+- (id)copyWithZone:(NSZone *)_zone {
+  iCalPerson *new;
+  
+  new = [super copyWithZone:_zone];
+  
+  ASSIGNCOPY(new->cn,       self->cn);
+  ASSIGNCOPY(new->email,    self->email);
+  ASSIGNCOPY(new->rsvp,     self->rsvp);
+  ASSIGNCOPY(new->partStat, self->partStat);
+  ASSIGNCOPY(new->role,     self->role);
+  ASSIGNCOPY(new->xuid,     self->xuid);
+  
+  return new;
+}
+
 /* accessors */
 
 - (void)setCn:(NSString *)_s {
 }
 
 - (BOOL)hasSameEmailAddress:(iCalPerson *)_other {
-  return IS_EQUAL([self email], [_other email], isEqualToString:);
+  return IS_EQUAL([[self email] lowercaseString],
+                  [[_other email] lowercaseString],
+                  isEqualToString:);
 }
 
 /* descriptions */