+2005-07-18 Helge Hess <helge.hess@opengroupware.org>
+
+ * UIxMailRenderingContext.m: show text/plain and text/html attachments
+ which have "filename" set in the content-disposition using the link
+ viewer (#1468) (v0.9.16)
+
2005-07-18 Helge Hess <helge.hess@opengroupware.org>
* UIxMailRenderingContext.m: map multipart/report mimetype to use the
@implementation UIxMailRenderingContext
+static BOOL showNamedTextAttachmentsInline = NO;
+
- (id)initWithViewer:(WOComponent *)_viewer context:(WOContext *)_ctx {
if ((self = [super init])) {
self->viewer = _viewer;
return [self mixedViewer];
}
else if ([mt isEqualToString:@"text"]) {
- if ([st isEqualToString:@"plain"])
- return [self textViewer];
-
- if ([st isEqualToString:@"html"])
- return [self htmlViewer]; // TODO: temporary workaround
+ /*
+ Note: in the _info dictionary we do not get the content-disposition
+ information (inline vs attachment). Our hack is to check for the
+ 'name' parameter.
+ */
+ if ([st isEqualToString:@"plain"] || [st isEqualToString:@"html"]) {
+ if (!showNamedTextAttachmentsInline) {
+ NSString *n;
+
+ n = [[_info objectForKey:@"parameterList"] objectForKey:@"name"];
+ if ([n isNotNull] && [n length] > 0)
+ return [self linkViewer];
+ }
+
+ return [st isEqualToString:@"html"]
+ ? [self htmlViewer] : [self textViewer];
+ }
if ([st isEqualToString:@"calendar"])
return [self iCalViewer];