parent
a23fef66ba
commit
40b570cc12
|
@ -252,6 +252,7 @@
|
|||
if ([_st isEqualToString:@"gif"]) return @"gif";
|
||||
if ([_st isEqualToString:@"jpeg"]) return @"jpg";
|
||||
if ([_st isEqualToString:@"png"]) return @"png";
|
||||
if ([_st isEqualToString:@"svg+xml"]) return @"svg";
|
||||
}
|
||||
else if ([_mt isEqualToString:@"text"]) {
|
||||
if ([_st isEqualToString:@"plain"]) return @"txt";
|
||||
|
@ -326,9 +327,13 @@
|
|||
- (NSString *) _pathForAttachmentOrDownload: (BOOL) forDownload
|
||||
{
|
||||
SOGoMailBodyPart *bodyPart;
|
||||
NSString *s, *attachment;
|
||||
NSString *st, *s, *attachment;
|
||||
NSMutableString *url;
|
||||
|
||||
st = [[bodyInfo valueForKey:@"subtype"] lowercaseString];
|
||||
if (!forDownload && [st isEqualToString: @"svg+xml"])
|
||||
return nil;
|
||||
|
||||
bodyPart = [self clientPart];
|
||||
s = [[self clientObject] baseURLInContext: [self context]];
|
||||
|
||||
|
|
|
@ -47,8 +47,7 @@
|
|||
|
||||
s = [[info objectForKey:@"disposition"] objectForKey: @"type"];
|
||||
|
||||
shouldDisplay = (s && ([s caseInsensitiveCompare: @"ATTACHMENT"]
|
||||
== NSOrderedSame));
|
||||
shouldDisplay = (s && ([s caseInsensitiveCompare: @"ATTACHMENT"] == NSOrderedSame));
|
||||
|
||||
if (!shouldDisplay && !textPart)
|
||||
shouldDisplay = ([[info objectForKey: @"bodyId"] length] ? YES : NO);
|
||||
|
@ -219,7 +218,7 @@ static BOOL showNamedTextAttachmentsInline = NO;
|
|||
if ([mt isEqualToString: @"image"] &&
|
||||
!([st isEqualToString: @"tiff"] || [st isEqualToString: @"pdf"]))
|
||||
{
|
||||
if ([self _shouldDisplayAsAttachment: _info textPart: NO])
|
||||
if ([self _shouldDisplayAsAttachment: _info textPart: NO] || [st isEqualToString: @"svg+xml"])
|
||||
return [self linkViewer];
|
||||
|
||||
return [self imageViewer];
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
<div class="md-flex sg-attachment-size">
|
||||
<var:string value="bodyInfo.size" formatter="sizeFormatter"/>
|
||||
</div>
|
||||
<md-button class="sg-icon-button" var:href="pathToAttachment" target="_blank">
|
||||
<var:if condition="pathToAttachment.length"><md-button class="sg-icon-button" var:href="pathToAttachment" target="_blank">
|
||||
<md-tooltip md-direction="left"><var:string label:value="View Attachment"/></md-tooltip>
|
||||
<md-icon>open_in_new</md-icon>
|
||||
</md-button>
|
||||
</md-button></var:if>
|
||||
<md-button class="sg-icon-button" var:href="pathForDownload">
|
||||
<md-tooltip md-direction="left"><var:string label:value="Save Attachment"/></md-tooltip>
|
||||
<md-icon>file_download</md-icon>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
partSrc = angular.element(this.message.$content()[partIndex].content).find('img')[0].src;
|
||||
|
||||
var images = _.filter(this.message.attachmentAttrs, function(attrs) {
|
||||
return attrs.mimetype.indexOf('image/') === 0;
|
||||
return attrs.mimetype.indexOf('image/') === 0 && attrs.mimetype.indexOf('svg+xml') < 0;
|
||||
});
|
||||
|
||||
var selectedIndex = _.findIndex(images, function(image) {
|
||||
|
|
Loading…
Reference in New Issue