From c3ff8a40846d62202f2f50312ec21e2c7705a194 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 12 Nov 2007 19:54:07 +0000 Subject: [PATCH 1/4] Monotone-Parent: 2d4a926cb463fbf80ac0aa402d2ed4efa912738c Monotone-Revision: 29e8928c560132fd7098a5e3c3897e4e214c3739 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-12T19:54:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f9a1ce434..e0a3bda96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,7 +16,8 @@ ([UIxMailPartICalViewer -declineLink]) ([UIxMailPartICalViewer -tentativeLink]): removed useless methods. - * UI/MailPartViewers/UIxMailPartICalAction.m ([UIxMailPartICalAction -addToCalendarAction]) + * UI/MailPartViewers/UIxMailPartICalAction.m + ([UIxMailPartICalAction -addToCalendarAction]) ([UIxMailPartICalAction -deleteFromCalendarAction]): new stub methods. From 5d2d7bbae748a935941f7e696233041121991123 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 12 Nov 2007 19:54:16 +0000 Subject: [PATCH 2/4] Monotone-Parent: 29e8928c560132fd7098a5e3c3897e4e214c3739 Monotone-Revision: 792be98e654b3cfa62f4f11c932b36e8f665af0d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-12T19:54:16 Monotone-Branch: ca.inverse.sogo --- SoObjects/Appointments/SOGoAptMailNotification.m | 1 + 1 file changed, 1 insertion(+) diff --git a/SoObjects/Appointments/SOGoAptMailNotification.m b/SoObjects/Appointments/SOGoAptMailNotification.m index 912c3a0e2..b08bf74df 100644 --- a/SoObjects/Appointments/SOGoAptMailNotification.m +++ b/SoObjects/Appointments/SOGoAptMailNotification.m @@ -82,6 +82,7 @@ static NSTimeZone *EST = nil; - (NSString *)homePageURL { return self->homePageURL; } + - (void)setHomePageURL:(NSString *)_homePageURL { ASSIGN(self->homePageURL, _homePageURL); } From 0dafa1fbe33a081cda610f60ceb60af3032ce648 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 12 Nov 2007 19:56:20 +0000 Subject: [PATCH 3/4] Monotone-Parent: 792be98e654b3cfa62f4f11c932b36e8f665af0d Monotone-Revision: c98770f24cfa85b41238be62c18aeaad6380a583 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-12T19:56:20 Monotone-Branch: ca.inverse.sogo --- .../Appointments/SOGoAppointmentObject.m | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 7cc44e230..cac6db9ef 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -252,36 +252,32 @@ uid = [self getUIDForICalPerson: organizer]; if (!uid) uid = [self ownerInContext: nil]; - if (uid) { - if (![storeUIDs containsObject:uid]) - [storeUIDs addObject:uid]; - [removedUIDs removeObject:uid]; - } + if (uid) + { + [storeUIDs addObjectUniquely: uid]; + [removedUIDs removeObject: uid]; + } /* organizer might have changed completely */ - if (oldApt && ([props containsObject: @"organizer"])) { - uid = [self getUIDForICalPerson:[oldApt organizer]]; - if (uid) { - if (![storeUIDs containsObject:uid]) { - if (![removedUIDs containsObject:uid]) { - [removedUIDs addObject:uid]; - } - } + if (oldApt && ([props containsObject: @"organizer"])) + { + uid = [self getUIDForICalPerson: [oldApt organizer]]; + if (uid && ![storeUIDs containsObject: uid]) + [removedUIDs addObjectUniquely: uid]; } - } - [self debugWithFormat:@"UID ops:\n store: %@\n remove: %@", + [self debugWithFormat: @"UID ops:\n store: %@\n remove: %@", storeUIDs, removedUIDs]; /* if time did change, all participants have to re-decide ... * ... exception from that rule: the organizer */ - if (oldApt != nil && - ([props containsObject: @"startDate"] || - [props containsObject: @"endDate"] || - [props containsObject: @"duration"])) + if (oldApt + && ([props containsObject: @"startDate"] + || [props containsObject: @"endDate"] + || [props containsObject: @"duration"])) { NSArray *ps; unsigned i, count; @@ -320,15 +316,16 @@ andNewObject: newApt toAttendees: attendees]; - if (updateForcesReconsider) { - attendees = [NSMutableArray arrayWithArray:[newApt attendees]]; - [attendees removeObjectsInArray:[changes insertedAttendees]]; - [attendees removePerson:organizer]; - [self sendEMailUsingTemplateNamed: @"Update" - forOldObject: oldApt - andNewObject: newApt - toAttendees: attendees]; - } + if (updateForcesReconsider) + { + attendees = [NSMutableArray arrayWithArray:[newApt attendees]]; + [attendees removeObjectsInArray:[changes insertedAttendees]]; + [attendees removePerson:organizer]; + [self sendEMailUsingTemplateNamed: @"Update" + forOldObject: oldApt + andNewObject: newApt + toAttendees: attendees]; + } attendees = [NSMutableArray arrayWithArray: [changes deletedAttendees]]; @@ -393,8 +390,8 @@ && [self _aptIsStillRelevant: apt]) { /* send notification email to attendees excluding organizer */ - attendees = [NSMutableArray arrayWithArray:[apt attendees]]; - [attendees removePerson:[apt organizer]]; + attendees = [NSMutableArray arrayWithArray: [apt attendees]]; + [attendees removePerson: [apt organizer]]; /* flag appointment as being cancelled */ [(iCalCalendar *) [apt parent] setMethod: @"cancel"]; From ce13f57d237c4ea29c202ad54a81c53f30340eb6 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 12 Nov 2007 20:56:56 +0000 Subject: [PATCH 4/4] Monotone-Parent: c98770f24cfa85b41238be62c18aeaad6380a583 Monotone-Revision: 2699a7bfc566b3d087c4b5ed82888408feaa4fb3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-12T20:56:56 Monotone-Branch: ca.inverse.sogo --- SOPE/NGCards/ChangeLog | 7 +++++++ SOPE/NGCards/iCalTimeZonePeriod.m | 35 +++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 549ad5a29..ec0c0c542 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,10 @@ +2007-11-12 Wolfgang Sourdeau + + * iCalTimeZonePeriod.m ([iCalTimeZonePeriod + -occurenceForDate:refDate]): added support for timezone periods + which do not contain a recurrence rule, such as the one provided + by iCal. + 2007-11-02 Wolfgang Sourdeau * iCalDateHolder.m ([iCalDateHolder -awakeAfterUsingSaxDecoder:]): diff --git a/SOPE/NGCards/iCalTimeZonePeriod.m b/SOPE/NGCards/iCalTimeZonePeriod.m index 29bd9bb17..dc1f611fd 100644 --- a/SOPE/NGCards/iCalTimeZonePeriod.m +++ b/SOPE/NGCards/iCalTimeZonePeriod.m @@ -99,35 +99,48 @@ return dayOfWeek; } -- (NSCalendarDate *) occurenceForDate: (NSCalendarDate *) refDate; +- (NSCalendarDate *) _occurenceForDate: (NSCalendarDate *) refDate + byRRule: (iCalRecurrenceRule *) rrule { NSCalendarDate *tmpDate; - iCalRecurrenceRule *rrule; NSString *byDay; int dayOfWeek, dateDayOfWeek, offset, pos; - rrule = (iCalRecurrenceRule *) [self uniqueChildWithTag: @"rrule"]; byDay = [rrule namedValue: @"byday"]; dayOfWeek = [self dayOfWeekFromRruleDay: [rrule byDayMask]]; pos = [[byDay substringToIndex: 2] intValue]; if (!pos) pos = 1; - tmpDate = [NSCalendarDate - dateWithYear: [refDate yearOfCommonEra] - month: [[rrule namedValue: @"bymonth"] intValue] - day: 1 hour: 0 minute: 0 second: 0 - timeZone: [NSTimeZone timeZoneWithName: @"GMT"]]; + tmpDate = [NSCalendarDate dateWithYear: [refDate yearOfCommonEra] + month: [[rrule namedValue: @"bymonth"] intValue] + day: 1 hour: 0 minute: 0 second: 0 + timeZone: [NSTimeZone timeZoneWithName: @"GMT"]]; tmpDate = [tmpDate addYear: 0 month: ((pos > 0) ? 0 : 1) - day: 0 hour: 0 minute: 0 - second: -[self _secondsOfOffset: @"tzoffsetfrom"]]; + day: 0 hour: 0 minute: 0 + second: -[self _secondsOfOffset: @"tzoffsetfrom"]]; dateDayOfWeek = [tmpDate dayOfWeek]; offset = (dayOfWeek - dateDayOfWeek); if (pos > 0 && offset < 0) offset += 7; offset += (pos * 7); tmpDate = [tmpDate addYear: 0 month: 0 day: offset - hour: 0 minute: 0 second: 0]; + hour: 0 minute: 0 second: 0]; + + return tmpDate; +} + +- (NSCalendarDate *) occurenceForDate: (NSCalendarDate *) refDate; +{ + NSCalendarDate *tmpDate; + iCalRecurrenceRule *rrule; + + rrule = (iCalRecurrenceRule *) [self uniqueChildWithTag: @"rrule"]; + if ([rrule isVoid]) + tmpDate + = [(iCalDateTime *) [self uniqueChildWithTag: @"dtstart"] dateTime]; + else + tmpDate = [self _occurenceForDate: refDate byRRule: rrule]; return tmpDate; }