From 64d1eeab3b275db13e7b5177cb1ead30119f197f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 1 Apr 2011 17:54:23 +0000 Subject: [PATCH] Monotone-Parent: 9872ae08d0e84f59ec67ccfa772caf1a9d1c613f Monotone-Revision: f0f12cec0b288caae2086872cad9e044311da3b9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-04-01T17:54:23 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 +++ .../Appointments/SOGoCalendarComponent.m | 26 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) 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];