diff --git a/ChangeLog b/ChangeLog index 304011c3f..828e27eec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-09-06 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentObject.m + ([SOGoAppointmentObject -saveContentString:_iCalbaseSequence:_v]): + check whether the new appointment object is still relevant before + sending a notification. + 2007-09-05 Wolfgang Sourdeau * SoObjects/SOGo/SOGoWebAuthenticator.m ([SOGoWebAuthenticator diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 1058df10c..e394ff5d6 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -19,6 +19,8 @@ 02111-1307, USA. */ +#import + #import #import #import @@ -181,6 +183,14 @@ } /* "iCal multifolder saves" */ +- (BOOL) _aptIsStillRelevant: (iCalEvent *) appointment +{ + NSCalendarDate *now; + + now = [NSCalendarDate calendarDate]; + + return ([[appointment endDate] earlierDate: now] == now); +} - (NSException *) saveContentString: (NSString *) _iCal baseSequence: (int) _v @@ -321,9 +331,11 @@ if (delError != nil) return delError; /* email notifications */ - if ([self sendEMailNotifications]) + if ([self sendEMailNotifications] + && [self _aptIsStillRelevant: newApt]) { - attendees = [NSMutableArray arrayWithArray: [changes insertedAttendees]]; + attendees + = [NSMutableArray arrayWithArray: [changes insertedAttendees]]; [attendees removePerson: organizer]; [self sendEMailUsingTemplateNamed: @"Invitation" forOldObject: nil @@ -340,7 +352,8 @@ toAttendees: attendees]; } - attendees = [NSMutableArray arrayWithArray:[changes deletedAttendees]]; + attendees + = [NSMutableArray arrayWithArray: [changes deletedAttendees]]; [attendees removePerson: organizer]; if ([attendees count]) {