diff --git a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m index cb0c89d32a..a6f653f4b4 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m +++ b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m @@ -78,11 +78,14 @@ #import #import +#import + #import #import #import #import #import +#import #import #import @@ -264,7 +267,26 @@ - (NSString *) _getNameInCache: (id) theCollection withType: (SOGoMicrosoftActiv return nameInCache; } +- (void) _removeAllAlarmsFromCalendar: (iCalCalendar *) theCalendar +{ + NSArray *allComponents; + iCalEntityObject *currentComponent; + NSUInteger count, max; + + if (debugOn) + [self logWithFormat: @"EAS - Remove all alarms"]; + + allComponents = [theCalendar allObjects]; + max = [allComponents count]; + for (count = 0; count < max; count++) + { + currentComponent = [allComponents objectAtIndex: count]; + if ([currentComponent isKindOfClass: [iCalEvent class]] || + [currentComponent isKindOfClass: [iCalToDo class]]) + [currentComponent removeAllAlarms]; + } +} // // @@ -1239,6 +1261,9 @@ - (void) processSyncGetChanges: (id ) theDocumentElement d = [NSCalendarDate distantFuture]; [dateCache setObject: d forKey: uid]; + + if (!([theCollection showCalendarAlarms])) + [self _removeAllAlarmsFromCalendar: [componentObject parent]]; } if (updated) @@ -1599,7 +1624,7 @@ - (void) processSyncGetChanges: (id ) theDocumentElement [s appendString: [mailObject activeSyncRepresentationInContext: context]]; [s appendString: @""]; [s appendString: @""]; - + [syncCache setObject: [aCacheObject sequence] forKey: [aCacheObject uid]]; [dateCache setObject: [NSCalendarDate date] forKey: [aCacheObject uid]];