diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 59bb5ddc3..c2ab6817f 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -1722,37 +1722,6 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent } } -- (void) _adjustClassificationInRequestCalendar: (iCalCalendar *) rqCalendar -{ - SOGoUserDefaults *userDefaults; - NSString *accessClass; - NSArray *allObjects; - id entity; - - int i; - - userDefaults = [[context activeUser] userDefaults]; - allObjects = [rqCalendar allObjects]; - - for (i = 0; i < [allObjects count]; i++) - { - entity = [allObjects objectAtIndex: i]; - - if ([entity respondsToSelector: @selector(accessClass)]) - { - accessClass = [entity accessClass]; - - if (!accessClass || [accessClass length] == 0) - { - if ([entity isKindOfClass: [iCalEvent class]]) - [entity setAccessClass: [userDefaults calendarEventsDefaultClassification]]; - else if ([entity isKindOfClass: [iCalToDo class]]) - [entity setAccessClass: [userDefaults calendarTasksDefaultClassification]]; - } - } - } -} - // // iOS devices (and potentially others) send event invitations with no PARTSTAT defined. // This confuses DAV clients like Thunderbird, or event SOGo web. The RFC says: @@ -1969,7 +1938,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent } [self _adjustEventsInRequestCalendar: calendar]; - [self _adjustClassificationInRequestCalendar: calendar]; + [self adjustClassificationInRequestCalendar: calendar]; [self _adjustPartStatInRequestCalendar: calendar]; } diff --git a/SoObjects/Appointments/SOGoCalendarComponent.h b/SoObjects/Appointments/SOGoCalendarComponent.h index e1e2bc7bd..93219f679 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.h +++ b/SoObjects/Appointments/SOGoCalendarComponent.h @@ -93,6 +93,8 @@ - (void) snoozeAlarm: (unsigned int) minutes; +- (void) adjustClassificationInRequestCalendar: (iCalCalendar *) rqCalendar; + @end #endif /* SOGOCALENDARCOMPONENT_H */ diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 762139774..6833c8e70 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -1394,4 +1394,36 @@ // return values; // } +- (void) adjustClassificationInRequestCalendar: (iCalCalendar *) rqCalendar +{ + SOGoUserDefaults *userDefaults; + NSString *accessClass; + NSArray *allObjects; + id entity; + + int i; + + userDefaults = [[context activeUser] userDefaults]; + allObjects = [rqCalendar allObjects]; + + for (i = 0; i < [allObjects count]; i++) + { + entity = [allObjects objectAtIndex: i]; + + if ([entity respondsToSelector: @selector(accessClass)]) + { + accessClass = [entity accessClass]; + + if (!accessClass || [accessClass length] == 0) + { + if ([entity isKindOfClass: [iCalEvent class]]) + [entity setAccessClass: [userDefaults calendarEventsDefaultClassification]]; + else if ([entity isKindOfClass: [iCalToDo class]]) + [entity setAccessClass: [userDefaults calendarTasksDefaultClassification]]; + } + } + } +} + + @end diff --git a/SoObjects/Appointments/SOGoTaskObject.m b/SoObjects/Appointments/SOGoTaskObject.m index 3e1343726..e51641556 100644 --- a/SoObjects/Appointments/SOGoTaskObject.m +++ b/SoObjects/Appointments/SOGoTaskObject.m @@ -24,6 +24,8 @@ #import #import +#import +#import #import #import #import @@ -114,4 +116,17 @@ } +- (id) PUTAction: (WOContext *) _ctx +{ + iCalCalendar *rqCalendar; + WORequest *rq; + + rq = [_ctx request]; + rqCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]]; + [self adjustClassificationInRequestCalendar: rqCalendar]; + [rq setContent: [[rqCalendar versitString] dataUsingEncoding: [rq contentEncoding]]]; + + return [super PUTAction: _ctx]; +} + @end /* SOGoTaskObject */