From 295351b56a47991fc1b69a0cb970f79900d22cad Mon Sep 17 00:00:00 2001 From: wolfgang Date: Thu, 24 Jan 2008 15:39:34 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1338 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 15 +++++++++++++++ OGoContentStore/OCSiCalFieldExtractor.m | 8 ++++++++ .../Appointments/SOGoAppointmentFolder.m | 19 ++++++++++++++----- UI/MailPartViewers/UIxMailPartViewer.m | 10 +++++++--- .../MailPartViewers/UIxMailPartICalViewer.wox | 2 +- 5 files changed, 45 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ca4d37d..2c004999 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-01-24 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolder.m: if c_cycleinfo + is an NSNull instance, we consider it to be empty and return + automatically with an error message in the log. + + * OGoContentStore/OCSiCalFieldExtractor.m ([OCSiCalFieldExtractor + -extractQuickFieldsFromTodo:_task]): handle recurrence info in + tasks. + + * UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer + -pathToAttachment]): in the case where the client object is not a + mail body part (when the message IS the attachment), we append 0 + to generate the url, instead of the filename. + 2008-01-22 Wolfgang Sourdeau * SoObjects/Appointments/SOGoAppointmentFolder.m diff --git a/OGoContentStore/OCSiCalFieldExtractor.m b/OGoContentStore/OCSiCalFieldExtractor.m index cda920e2..f68537f9 100644 --- a/OGoContentStore/OCSiCalFieldExtractor.m +++ b/OGoContentStore/OCSiCalFieldExtractor.m @@ -282,6 +282,14 @@ static NSNumber *distantFutureNumber = nil; date = [NSNull null]; [row setObject: date forKey: @"c_enddate"]; + if ([_task isRecurrent]) + { + [row setObject: [self numberForDate: distantFuture] + forKey: @"c_cycleenddate"]; + [row setObject: [_task cycleInfo] + forKey: @"c_cycleinfo"]; + } + if ([participants length] > 0) [row setObject:participants forKey: @"c_participants"]; if ([partmails length] > 0) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 190982a9..aec706ee 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -634,12 +634,21 @@ static NSNumber *sharedYes = nil; NGCalendarDateRange *fir; NSArray *rules, *exRules, *exDates, *ranges; unsigned i, count; + NSString *content; - cycleinfo = [[_row objectForKey:@"c_cycleinfo"] propertyList]; - if (cycleinfo == nil) { - [self errorWithFormat:@"cyclic record doesn't have cycleinfo -> %@", _row]; - return; - } + content = [_row objectForKey: @"c_cycleinfo"]; + if (![content isNotNull]) + { + [self errorWithFormat:@"cyclic record doesn't have cycleinfo -> %@", _row]; + return; + } + + cycleinfo = [content propertyList]; + if (!cycleinfo) + { + [self errorWithFormat:@"cyclic record doesn't have cycleinfo -> %@", _row]; + return; + } row = [self fixupRecord:_row fetchRange: _r]; [row removeObjectForKey: @"c_cycleinfo"]; diff --git a/UI/MailPartViewers/UIxMailPartViewer.m b/UI/MailPartViewers/UIxMailPartViewer.m index 96b9e50a..4f3a177f 100644 --- a/UI/MailPartViewers/UIxMailPartViewer.m +++ b/UI/MailPartViewers/UIxMailPartViewer.m @@ -303,7 +303,7 @@ if (![url hasSuffix: @"/"]) url = [url stringByAppendingString: @"/"]; - /* if we get a message with an image/* or application/* + /* if we get a message with an image-* or application-* Content-Type, we must generate a 'fake' part since our decoded mail won't have any. Also see SOGoMailBodyPart: -fetchBLOB and SOGoMailObject: -lookupImap4BodyPartKey: inContext for @@ -343,7 +343,7 @@ - (NSString *) pathToAttachment { NSMutableString *url; - NSString *s; + NSString *s, *attachment; SOGoMailBodyPart *bodyPart; bodyPart = [self clientPart]; @@ -353,7 +353,11 @@ [url appendString: @"/"]; // s = [[self partPath] componentsJoinedByString: @"/"]; - [url appendString: [self _filenameForAttachment: bodyPart]]; + if ([bodyPart isKindOfClass: [SOGoMailBodyPart class]]) + attachment = [self _filenameForAttachment: bodyPart]; + else + attachment = @"0"; + [url appendString: attachment]; return url; } diff --git a/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox b/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox index 701eef9d..e6a9771d 100644 --- a/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox +++ b/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox @@ -206,5 +206,5 @@

--> -
+ -- 2.39.5