diff --git a/ChangeLog b/ChangeLog index 18950af6f..95e2f8bd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-04-01 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoCalendarComponent.m + (-contentAsString): strip alarms from component if the alarms are + disabled on the containing calendar. + * SoObjects/SOGo/SOGoObject.m (-davComplianceClassesInContext:): added "calendar-auto-schedule", "calendar-proxy" and "calenderserver-principal-property diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index a9a17d630..5a0f5fd8d 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -408,12 +408,36 @@ static inline BOOL _occurenceHasID (iCalRepeatableEntityObject *occurence, return obj; } +- (NSString *) _secureContentWithoutAlarms +{ + iCalCalendar *calendar; + NSArray *allComponents; + iCalEntityObject *currentComponent; + NSUInteger count, max; + + calendar = [self calendar: NO secure: YES]; + allComponents = [calendar childrenWithTag: [self componentTag]]; + max = [allComponents count]; + for (count = 0; count < max; count++) + { + currentComponent = [allComponents objectAtIndex: count]; + [currentComponent removeAllAlarms]; + } + + return [calendar versitString]; +} + - (NSString *) contentAsString { NSString *secureContent; if ([[context request] isSoWebDAVRequest]) - secureContent = [self secureContentAsString]; + { + if ([container showCalendarAlarms]) + secureContent = [self secureContentAsString]; + else + secureContent = [self _secureContentWithoutAlarms]; + } else secureContent = [super contentAsString];