From f5b4ab332567241f55cc8c0095b080ce3ee1acca Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 8 Jun 2009 17:16:09 +0000 Subject: [PATCH] Monotone-Parent: ebecad29c1790b7953cfe00229ae3666abb9f896 Monotone-Revision: 1f66b697aa5dc8a2fb659718acc74a79c3a3576b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-06-08T17:16:09 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++ .../Appointments/SOGoAppointmentFolder.m | 31 --------------- SoObjects/SOGo/SOGoGCSFolder.m | 38 +++++++++++++++++-- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0ea75311..b70f00530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-08 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoGCSFolder.m (-davCollectionTag): moved method + from SOGoAppointmentFolder since we will need it for contacts + folders as well. + 2009-06-08 Cyril Robert * SoObjects/Appointments/SOGoAppointmentFolder.m: Added c_cycleenddate in diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 1ffc83ca7..1e54a720d 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2231,37 +2231,6 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir return colType; } -- (NSString *) davCollectionTag -{ - NSArray *records; - GCSFolder *folder; - static EOFetchSpecification *cTagSpec = nil; - EOSortOrdering *ordering; - NSNumber *lastModified; - NSString *cTag; - - folder = [self ocsFolder]; - ordering = [EOSortOrdering sortOrderingWithKey: @"c_lastmodified" - selector: EOCompareDescending]; - cTagSpec = [EOFetchSpecification - fetchSpecificationWithEntityName: [folder folderName] - qualifier: nil - sortOrderings: [NSArray arrayWithObject: ordering]]; - - records = [folder fetchFields: [NSArray arrayWithObject: @"c_lastmodified"] - fetchSpecification: cTagSpec - ignoreDeleted: NO]; - if ([records count]) - { - lastModified = [[records objectAtIndex: 0] objectForKey: @"c_lastmodified"]; - cTag = [lastModified stringValue]; - } - else - cTag = @"-1"; - - return cTag; -} - - (NSString *) davDescription { return @""; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 7c665f1e4..68a8bab55 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -611,6 +611,38 @@ static NSArray *childRecordFields = nil; } } +- (NSString *) davCollectionTag +{ + NSArray *records; + GCSFolder *folder; + static EOFetchSpecification *cTagSpec = nil; + EOSortOrdering *ordering; + NSNumber *lastModified; + NSString *cTag; + + folder = [self ocsFolder]; + ordering = [EOSortOrdering sortOrderingWithKey: @"c_lastmodified" + selector: EOCompareDescending]; + cTagSpec = [EOFetchSpecification + fetchSpecificationWithEntityName: [folder folderName] + qualifier: nil + sortOrderings: [NSArray arrayWithObject: ordering]]; + + records = [folder fetchFields: [NSArray arrayWithObject: @"c_lastmodified"] + fetchSpecification: cTagSpec + ignoreDeleted: NO]; + if ([records count]) + { + lastModified = [[records objectAtIndex: 0] + objectForKey: @"c_lastmodified"]; + cTag = [lastModified stringValue]; + } + else + cTag = @"-1"; + + return cTag; +} + #warning this code should be cleaned up - (void) _subscribeUser: (SOGoUser *) subscribingUser reallyDo: (BOOL) reallyDo @@ -744,15 +776,15 @@ static NSArray *childRecordFields = nil; - (id ) davSubscribe: (WOContext *) queryContext { return [self subscribe: YES - inTheNamesOf: [self _parseDAVDelegatedUser: queryContext] - fromMailInvitation: NO + inTheNamesOf: [self _parseDAVDelegatedUser: queryContext] + fromMailInvitation: NO inContext: queryContext]; } - (id ) davUnsubscribe: (WOContext *) queryContext { return [self subscribe: NO - inTheNamesOf: [self _parseDAVDelegatedUser: queryContext] + inTheNamesOf: [self _parseDAVDelegatedUser: queryContext] fromMailInvitation: NO inContext: queryContext]; }