From 3964cc04d51e1937a53f377d3bab1b33df0aff0a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Sep 2007 20:51:59 +0000 Subject: [PATCH] Monotone-Parent: d20ec84ad2b4b3caf96c35a13c3f6b3c714ea6e3 Monotone-Revision: 841f4e0f7b8c42d31d853c73f76ede6b5aad76e9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-09-06T20:51:59 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ .../Appointments/SOGoAppointmentObject.m | 19 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) 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]) {