]> err.no Git - scalable-opengroupware.org/blobdiff - SOPE/NGCards/iCalEntityObject.m
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1263 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / SOPE / NGCards / iCalEntityObject.m
index 39f2afce2944f3831e13137285ad863ad1ce1038..53a51c1f625a4c8b118f54a80ae9bfa36d9a8451 100644 (file)
   return nil; /* not found */
 }
 
+- (NSComparisonResult) _compareVersions: (iCalEntityObject *) otherObject
+{
+  NSComparisonResult result;
+
+  result = [[self sequence] compare: [otherObject sequence]];
+  if (result == NSOrderedSame)
+    result = [[self lastModified] compare: [otherObject lastModified]];
+
+  return result;
+}
+
+- (NSComparisonResult) compare: (iCalEntityObject *) otherObject
+{
+  NSComparisonResult result;
+
+  if ([[self uid] isEqualToString: [otherObject uid]])
+    result = [self _compareVersions: otherObject];
+  else
+    result = [[self created] compare: [otherObject created]];
+
+  return result;
+}
+
 @end /* iCalEntityObject */