diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index e0620b845..819b6114a 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1470,15 +1470,13 @@ static Class sogoAppointmentFolderKlass = Nil; // has only asked for {DAV:}getetag with no other properties, // we do not load the c_content and other fields from the // database as this can be pretty costly. -#if 0 - // FOR AN UNKNOWN REASON FOR NOW, THIS GENERATES EMPTY ETAGS (ALL HAVE GCS0000000 VALUE) +#warning we should build the list of fields based on the requested props if ([*properties caseInsensitiveCompare: @"{DAV:}getetag"] == NSOrderedSame && !*(properties+1)) fields = [NSArray arrayWithObjects: @"c_name", @"c_creationdate", @"c_lastmodified", @"c_version", @"c_component", nil]; else -#endif fields = reportQueryFields; filterList = [filters objectEnumerator]; diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index c014c41a5..28ba25a9c 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -86,17 +86,25 @@ - (void) _setRecord: (NSDictionary *) objectRecord { - NSString *newContent; + id data; int intValue; - newContent = [objectRecord objectForKey: @"c_content"]; - if (newContent) + data = [objectRecord objectForKey: @"c_content"]; + if (data) + ASSIGN (content, data); + data = [objectRecord objectForKey: @"c_version"]; + if (data) + version = [data unsignedIntValue]; + data = [objectRecord objectForKey: @"c_creationdate"]; + if (data) { - ASSIGN (content, newContent); - version = [[objectRecord objectForKey: @"c_version"] unsignedIntValue]; - intValue = [[objectRecord objectForKey: @"c_creationdate"] intValue]; + intValue = [data intValue]; ASSIGN (creationDate, [NSCalendarDate dateWithTimeIntervalSince1970: intValue]); + } + data = [objectRecord objectForKey: @"c_lastmodified"]; + if (data) + { intValue = [[objectRecord objectForKey: @"c_lastmodified"] intValue]; ASSIGN (lastModified, [NSCalendarDate dateWithTimeIntervalSince1970: intValue]);