From 7c64a776511e04aae5f38af74dc188cd475f4348 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 23 Dec 2008 18:43:37 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 2d01f07e3065ada858d69113aed1fd68f365ab66 Monotone-Revision: 216cfb18d3e04f9ead5aaae0aa501e44f20b18df Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-12-23T18:43:37 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 ++++++ .../Appointments/SOGoAppointmentFolder.h | 16 +++++----- .../Appointments/SOGoAppointmentFolder.m | 29 +++++++++++-------- .../Appointments/SOGoAppointmentObject.h | 1 + .../Appointments/SOGoAppointmentObject.m | 1 + SoObjects/Appointments/iCalPerson+SOGo.h | 1 + 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51798e501..5c9d8451c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-12-23 Ludovic Marcotte + + * SoObjects/Appointments/SOGoAppointmentFolder.{h,m} + Added an additional parameter to fetchFields:... + so that we can avoid stripping relevant information. + This is useful when verifying the freebusy of + meeting participants as we must not strip the + c_partstates/c_partmails fields. + 2008-12-23 Francis Lachapelle * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.h b/SoObjects/Appointments/SOGoAppointmentFolder.h index 7a1a5250a..ff7925290 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.h +++ b/SoObjects/Appointments/SOGoAppointmentFolder.h @@ -1,5 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2007-2008 Inverse inc. This file is part of OpenGroupware.org. @@ -74,13 +75,14 @@ /* fetching */ -- (NSArray *) fetchFields: (NSArray *) _fields - from: (NSCalendarDate *) _startDate - to: (NSCalendarDate *) _endDate - title: (NSString *) title - component: (id) _component - additionalFilters: (NSString *) filters; - +- (NSArray *) fetchFields: (NSArray *) _fields + from: (NSCalendarDate *) _startDate + to: (NSCalendarDate *) _endDate + title: (NSString *) title + component: (id) _component + additionalFilters: (NSString *) filters + includeProtectedInformation: (BOOL) _includeProtectedInformation; + - (NSArray *) fetchCoreInfosFrom: (NSCalendarDate *) _startDate to: (NSCalendarDate *) _endDate title: (NSString *) title diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 76b275d16..c2b9ea195 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -838,6 +838,8 @@ static Class sogoAppointmentFolderKlass = Nil; { stripFields = [[NSMutableArray alloc] initWithCapacity: [fields count]]; [stripFields setArray: fields]; + + // What we keep.... [stripFields removeObjectsInArray: [NSArray arrayWithObjects: @"c_name", @"c_uid", @"c_startdate", @"c_enddate", @"c_isallday", @@ -877,12 +879,14 @@ static Class sogoAppointmentFolderKlass = Nil; } } -- (NSArray *) fetchFields: (NSArray *) _fields - from: (NSCalendarDate *) _startDate - to: (NSCalendarDate *) _endDate - title: (NSString *) title - component: (id) _component - additionalFilters: (NSString *) filters +- (NSArray *) fetchFields: (NSArray *) _fields + from: (NSCalendarDate *) _startDate + to: (NSCalendarDate *) _endDate + title: (NSString *) title + component: (id) _component + additionalFilters: (NSString *) filters + includeProtectedInformation: (BOOL) _includeProtectedInformation; + { EOQualifier *qualifier; GCSFolder *folder; @@ -994,13 +998,10 @@ static Class sogoAppointmentFolderKlass = Nil; [self debugWithFormat:@"returning %i records", [ma count]]; currentLogin = [[context activeUser] login]; - if (![currentLogin isEqualToString: owner]) + if (![currentLogin isEqualToString: owner] && !_includeProtectedInformation) [self _fixupProtectedInformation: [ma objectEnumerator] inFields: _fields forUser: currentLogin]; -// [ma makeObjectsPerform: @selector (setObject:forKey:) -// withObject: owner -// withObject: @"owner"]; if (rememberRecords) [self _rememberRecords: ma]; @@ -2226,11 +2227,14 @@ static Class sogoAppointmentFolderKlass = Nil; infos = [[NSArray alloc] initWithObjects: @"c_partmails", @"c_partstates", @"c_isopaque", @"c_status", @"c_cycleinfo", @"c_orgmail", nil]; + // We MUST include the protected information whenc checking for freebusy info as + // we rely on the c_partmails/c_partstates fields for many operations. return [self fetchFields: infos from: _startDate to: _endDate title: nil component: @"vevent" - additionalFilters: nil]; + additionalFilters: nil + includeProtectedInformation: YES]; } - (NSArray *) fetchCoreInfosFrom: (NSCalendarDate *) _startDate @@ -2262,7 +2266,8 @@ static Class sogoAppointmentFolderKlass = Nil; return [self fetchFields: infos from: _startDate to: _endDate title: title component: _component - additionalFilters: filters]; + additionalFilters: filters + includeProtectedInformation: NO]; } /* URL generation */ diff --git a/SoObjects/Appointments/SOGoAppointmentObject.h b/SoObjects/Appointments/SOGoAppointmentObject.h index e0d526922..a7ed90600 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.h +++ b/SoObjects/Appointments/SOGoAppointmentObject.h @@ -1,5 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2007-2008 Inverse inc. This file is part of OpenGroupware.org. diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 34af5e058..02961ac9e 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -1,5 +1,6 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2007-2008 Inverse inc. This file is part of OpenGroupware.org. diff --git a/SoObjects/Appointments/iCalPerson+SOGo.h b/SoObjects/Appointments/iCalPerson+SOGo.h index 5cb18138b..3467ff538 100644 --- a/SoObjects/Appointments/iCalPerson+SOGo.h +++ b/SoObjects/Appointments/iCalPerson+SOGo.h @@ -34,6 +34,7 @@ - (NSString *) mailAddress; - (NSString *) uid; - (BOOL) hasSentBy; +- (NSString *) sentBy; @end