diff --git a/ChangeLog b/ChangeLog index 84e07e25c..d23960f0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2012-07-20 Ludovic Marcotte + + * UI/MailPartViewers/UIxMailRenderingContext.m + (_shouldDisplayAsAttachment:): refactored to consider + the "bodyId" parameter only for non text/* parts. + +2012-07-20 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolder.m + (_appendCycleException:firstInstanceCalendarDateRange:fromRow:forRange:withTimeZone:toArray:): + return immediately if the occurrence does not have a valid + recurrence-id. + 2012-07-20 Francis Lachapelle * UI/WebServerResources/MailerUI.js (onEmailTo): append the email diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 29a64b77b..50cdd92f9 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -863,6 +863,11 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir newRecord = nil; recurrenceId = [component recurrenceId]; + if (!recurrenceId) + { + [self errorWithFormat: @"ignored component with an empty EXCEPTION-ID"]; + return; + } if (tz) { diff --git a/UI/MailPartViewers/UIxMailRenderingContext.m b/UI/MailPartViewers/UIxMailRenderingContext.m index 82113cac3..9b128f8a5 100644 --- a/UI/MailPartViewers/UIxMailRenderingContext.m +++ b/UI/MailPartViewers/UIxMailRenderingContext.m @@ -32,22 +32,25 @@ @interface UIxMailRenderingContext (Private) -- (BOOL) _shouldDisplayAsAttachment: (NSDictionary *) info; - +- (BOOL) _shouldDisplayAsAttachment: (NSDictionary *) info + textPart: (BOOL) textPart; @end @implementation UIxMailRenderingContext (Private) - (BOOL) _shouldDisplayAsAttachment: (NSDictionary *) info + textPart: (BOOL) textPart { NSString *s; BOOL shouldDisplay; s = [[info objectForKey:@"disposition"] objectForKey: @"type"]; - shouldDisplay = ((s && ([s caseInsensitiveCompare: @"ATTACHMENT"] - == NSOrderedSame)) - || [[info objectForKey: @"bodyId"] length]); + shouldDisplay = (s && ([s caseInsensitiveCompare: @"ATTACHMENT"] + == NSOrderedSame)); + + if (!shouldDisplay && !textPart) + shouldDisplay = ([[info objectForKey: @"bodyId"] length] ? YES : NO); return shouldDisplay; } @@ -198,7 +201,7 @@ static BOOL showNamedTextAttachmentsInline = NO; else if ([mt isEqualToString:@"text"]) { if ([st isEqualToString:@"plain"] || [st isEqualToString:@"html"]) { - if (!showNamedTextAttachmentsInline && [self _shouldDisplayAsAttachment: _info]) + if (!showNamedTextAttachmentsInline && [self _shouldDisplayAsAttachment: _info textPart:YES]) return [self linkViewer]; return [st isEqualToString:@"html"] @@ -212,7 +215,7 @@ static BOOL showNamedTextAttachmentsInline = NO; // Tiffs aren't well-supported if ([mt isEqualToString:@"image"] && ![st isEqualToString: @"tiff"]) { - if ([self _shouldDisplayAsAttachment: _info]) + if ([self _shouldDisplayAsAttachment: _info textPart: NO]) return [self linkViewer]; return [self imageViewer];