From be78b5890eb555c6911668e20a8f8286ed7d225d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 9 Jun 2009 21:10:25 +0000 Subject: [PATCH] Monotone-Parent: f98be962d0c592280a8de1c653bbe3828f18ecee Monotone-Revision: b577b5789ba850c92417e70690576edfd3a2793b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-06-09T21:10:25 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++--- SoObjects/Appointments/SOGoAppointmentFolder.m | 5 +++++ SoObjects/Appointments/SOGoFreeBusyObject.h | 6 +++++- SoObjects/Appointments/SOGoFreeBusyObject.m | 8 +++++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d64d960ea..c4dd70eb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,9 @@ 2009-06-09 Wolfgang Sourdeau * SoObjects/Appointments/SOGoFreeBusyObject.m - (-iCalStringForFreeBusyInfos:withMethod:andUID:from:to:): accept - an additional "UID" parameter that will be set as UID attribute on - the reported freebusy object. + (-iCalStringForFreeBusyInfos:withMethod:andUID:andOrganizer:from:to:): + accept additional "UID" and "organizer" parameters that will be set as + attributes on the reported freebusy object. * SoObjects/Appointments/SOGoAppointmentFolder.m (-freebusyResponseForRecipient:withUser:andCalendarData:): expose diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index d15dbac9b..08e4588c1 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2044,6 +2044,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir - (NSDictionary *) caldavFreeBusyRequestOnRecipient: (NSString *) recipient withUID: (NSString *) uid + andOrganizer: (iCalPerson *) organizer from: (NSCalendarDate *) start to: (NSCalendarDate *) to { @@ -2068,6 +2069,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir inContext: context]; calendarData = [freebusy contentAsStringWithMethod: @"REPLY" andUID: uid + andOrganizer: organizer from: start to: to]; } } @@ -2084,16 +2086,19 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir NSDictionary *responseElement; NSMutableArray *elements; NSString *recipient, *uid; + iCalPerson *organizer; NSEnumerator *allRecipients; NSCalendarDate *startDate, *endDate; elements = [NSMutableArray new]; [freebusy fillStartDate: &startDate andEndDate: &endDate]; uid = [freebusy uid]; + organizer = [freebusy organizer]; allRecipients = [recipients objectEnumerator]; while ((recipient = [allRecipients nextObject])) [elements addObject: [self caldavFreeBusyRequestOnRecipient: recipient withUID: uid + andOrganizer: organizer from: startDate to: endDate]]; responseElement = davElementWithContent (@"schedule-response", diff --git a/SoObjects/Appointments/SOGoFreeBusyObject.h b/SoObjects/Appointments/SOGoFreeBusyObject.h index 5cb36232a..c136d25b0 100644 --- a/SoObjects/Appointments/SOGoFreeBusyObject.h +++ b/SoObjects/Appointments/SOGoFreeBusyObject.h @@ -31,7 +31,10 @@ Represents Free/Busy information for a single user as specified in RFC2445. */ -@class NSArray, NSCalendarDate; +@class NSArray; +@class NSCalendarDate; + +@class iCalPerson; @interface SOGoFreeBusyObject : SOGoObject { @@ -45,6 +48,7 @@ to: (NSCalendarDate *) _endDate; - (NSString *) contentAsStringWithMethod: (NSString *) method andUID: (NSString *) uid + andOrganizer: (iCalPerson *) organizer from: (NSCalendarDate *) _startDate to: (NSCalendarDate *) _endDate; diff --git a/SoObjects/Appointments/SOGoFreeBusyObject.m b/SoObjects/Appointments/SOGoFreeBusyObject.m index b9990cfdc..5b790ee10 100644 --- a/SoObjects/Appointments/SOGoFreeBusyObject.m +++ b/SoObjects/Appointments/SOGoFreeBusyObject.m @@ -108,6 +108,7 @@ static unsigned int freebusyRangeEnd = 0; - (NSString *) iCalStringForFreeBusyInfos: (NSArray *) _infos withMethod: (NSString *) method andUID: (NSString *) uid + andOrganizer: (iCalPerson *) organizer from: (NSCalendarDate *) _startDate to: (NSCalendarDate *) _endDate { @@ -133,6 +134,8 @@ static unsigned int freebusyRangeEnd = 0; freebusy = [iCalFreeBusy groupWithTag: @"vfreebusy"]; if (uid) [freebusy setUid: uid]; + if (organizer) + [freebusy setOrganizer: organizer]; [freebusy addToAttendees: [self iCalPersonWithUID: login]]; [freebusy setTimeStampAsDate: [NSCalendarDate calendarDate]]; [freebusy setStartDate: _startDate]; @@ -214,6 +217,7 @@ static unsigned int freebusyRangeEnd = 0; - (NSString *) contentAsStringWithMethod: (NSString *) method andUID: (NSString *) UID + andOrganizer: (iCalPerson *) organizer from: (NSCalendarDate *) _startDate to: (NSCalendarDate *) _endDate { @@ -222,7 +226,8 @@ static unsigned int freebusyRangeEnd = 0; infos = [self fetchFreeBusyInfosFrom: _startDate to: _endDate]; return [self iCalStringForFreeBusyInfos: infos - withMethod: method andUID: UID + withMethod: method + andUID: UID andOrganizer: organizer from: _startDate to: _endDate]; } @@ -230,6 +235,7 @@ static unsigned int freebusyRangeEnd = 0; to: (NSCalendarDate *) _endDate { return [self contentAsStringWithMethod: nil andUID: nil + andOrganizer: nil from: _startDate to: _endDate]; }