diff --git a/SOPE/NGCards/iCalEventChanges.h b/SOPE/NGCards/iCalEventChanges.h index 7bb50893f..6b85984b0 100644 --- a/SOPE/NGCards/iCalEventChanges.h +++ b/SOPE/NGCards/iCalEventChanges.h @@ -1,24 +1,22 @@ -/* - Copyright (C) 2004-2005 SKYRIX Software AG - - This file is part of SOPE. - - SOPE is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - SOPE is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with SOPE; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. +/* iCalEventChanges.h - this file is part of SOPE + * + * Copyright (C) 2004-2016 Inverse inc. + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ -// Created by znek on 31.08.04. #ifndef __NGiCal_iCalEventChanges_H_ #define __NGiCal_iCalEventChanges_H_ @@ -41,6 +39,7 @@ - (id)initWithFromEvent:(iCalEvent *)_from toEvent:(iCalEvent *)_to; - (BOOL)hasChanges; +- (BOOL)hasMajorChanges; - (BOOL)hasAttendeeChanges; - (NSArray *)insertedAttendees; diff --git a/SOPE/NGCards/iCalEventChanges.m b/SOPE/NGCards/iCalEventChanges.m index a8c908e77..bc8283c11 100644 --- a/SOPE/NGCards/iCalEventChanges.m +++ b/SOPE/NGCards/iCalEventChanges.m @@ -1,22 +1,21 @@ -/* - Copyright (C) 2004-2005 SKYRIX Software AG - - This file is part of SOPE. - - SOPE is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - SOPE is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with SOPE; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. +/* iCalEventChanges.m - this file is part of SOPE + * + * Copyright (C) 2004-2016 Inverse inc. + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ #import @@ -158,6 +157,13 @@ [self hasPropertyChanges]; } +- (BOOL)hasMajorChanges { + return + [self hasAttendeeChanges] || + ([self hasPropertyChanges] && + ([[self updatedProperties] count] > 1 || ![[self updatedProperties] containsObject: @"lastModified"])); +} + - (BOOL)hasAttendeeChanges { return [[self insertedAttendees] count] > 0 || [[self deletedAttendees] count] > 0 || diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 912b5d69b..884876bed 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -891,7 +891,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent withType: @"calendar:invitation"]; } - if ([changes hasChanges]) + if ([changes hasMajorChanges]) [self sendReceiptEmailForObject: newEvent addedAttendees: addedAttendees deletedAttendees: deletedAttendees @@ -2275,11 +2275,13 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent } // if ([[newEvent attendees] count] || [[oldEvent attendees] count]) else { - [self sendReceiptEmailForObject: newEvent - addedAttendees: nil - deletedAttendees: nil - updatedAttendees: nil - operation: EventUpdated]; + changes = [iCalEventChanges changesFromEvent: oldEvent toEvent: newEvent]; + if ([changes hasMajorChanges]) + [self sendReceiptEmailForObject: newEvent + addedAttendees: nil + deletedAttendees: nil + updatedAttendees: nil + operation: EventUpdated]; } } // else of if (isNew) ...