mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-08 13:27:15 +00:00
Fix rendering of forwarded HTML message with img
Fixes #3981 (partially)
This commit is contained in:
1 parent
589827a414
commit
e5d0b0b0ca
7 files changed
+41
-4
No files matched your search
@@ -168,6 +168,7 @@
|
||||
viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: info];
|
||||
[viewer setBodyInfo: info];
|
||||
[viewer setPartPath: [self childPartPath]];
|
||||
[viewer setAttachmentIds: attachmentIds];
|
||||
[renderedParts addObject: [viewer renderedPart]];
|
||||
}
|
||||
|
||||
|
||||
@@ -609,8 +609,7 @@ static NSData* _sanitizeContent(NSData *theData)
|
||||
value = [_attributes valueAtIndex: count];
|
||||
if ([value hasPrefix: @"cid:"])
|
||||
{
|
||||
cid = [NSString stringWithFormat: @"<%@>",
|
||||
[value substringFromIndex: 4]];
|
||||
cid = [value substringFromIndex: 4];
|
||||
value = [attachmentIds objectForKey: cid];
|
||||
skipAttribute = (value == nil);
|
||||
}
|
||||
@@ -920,7 +919,7 @@ static NSData* _sanitizeContent(NSData *theData)
|
||||
createXMLReaderForMimeType: @"text/html"];
|
||||
|
||||
handler = [_UIxHTMLMailContentHandler new];
|
||||
[handler setAttachmentIds: [mail fetchFileAttachmentIds]];
|
||||
[handler setAttachmentIds: attachmentIds];
|
||||
|
||||
// We check if we got an unsupported charset. If so
|
||||
// we convert everything to UTF-16{LE,BE} so it passes
|
||||
@@ -1047,7 +1046,7 @@ static NSData* _sanitizeContent(NSData *theData)
|
||||
encoding = @"us-ascii";
|
||||
|
||||
handler = [_UIxHTMLMailContentHandler new];
|
||||
[handler setAttachmentIds: [mail fetchFileAttachmentIds]];
|
||||
[handler setAttachmentIds: attachmentIds];
|
||||
|
||||
// We check if we got an unsupported charset. If so
|
||||
// we convert everything to UTF-16{LE,BE} so it passes
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: info];
|
||||
[viewer setBodyInfo: info];
|
||||
[viewer setPartPath: [self childPartPath]];
|
||||
[viewer setAttachmentIds: attachmentIds];
|
||||
[renderedParts addObject: [viewer renderedPart]];
|
||||
}
|
||||
contentType = [NSString stringWithFormat: @"%@/%@",
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
@class NSArray;
|
||||
@class NSData;
|
||||
@class NSFormatter;
|
||||
@class NSMutableDictionary;
|
||||
|
||||
@class SOGoMailBodyPart;
|
||||
|
||||
@@ -53,6 +54,7 @@
|
||||
NSArray *partPath;
|
||||
id bodyInfo;
|
||||
NSData *flatContent;
|
||||
NSDictionary *attachmentIds;
|
||||
}
|
||||
|
||||
/* accessors */
|
||||
@@ -66,6 +68,8 @@
|
||||
- (SOGoMailBodyPart *) clientPart;
|
||||
- (id) renderedPart;
|
||||
|
||||
- (void) setAttachmentIds: (NSDictionary *) newAttachmentIds;
|
||||
|
||||
- (NSData *)flatContent;
|
||||
- (NSData *)decodedFlatContent;
|
||||
- (NSString *)flatContentAsString;
|
||||
|
||||
@@ -42,6 +42,16 @@
|
||||
|
||||
@implementation UIxMailPartViewer
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
attachmentIds = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[flatContent release];
|
||||
@@ -153,6 +163,11 @@
|
||||
nil];
|
||||
}
|
||||
|
||||
- (void) setAttachmentIds: (NSDictionary *) newAttachmentIds
|
||||
{
|
||||
attachmentIds = newAttachmentIds;
|
||||
}
|
||||
|
||||
- (NSData *) content
|
||||
{
|
||||
return [[self clientObject] fetchBLOB];
|
||||
|
||||
Reference in new issue
Block a user