diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 8ee1db18e..13e0e46a0 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -2481,6 +2481,10 @@ Defaults to `NO` when unset. Defaults to `inline` when unset. +|U |SOGoMailHideInlineAttachments +|Hide inline message as attachements if set to `YES`. Default value is `NO`. + + |U |SOGoMailCustomFullName |The string to use as full name when composing an email, if _SOGoMailCustomFromEnabled_ is set in the user's domain defaults. diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index d2b4479e2..c079f398a 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -228,8 +228,11 @@ extern NSString *SOGoPasswordRecoverySecondaryEmail; - (void) setMailLabelsColors: (NSDictionary *) newValues; - (NSDictionary *) mailLabelsColors; +- (void)setHideInlineAttachments:(BOOL)newValue; +- (BOOL)hideInlineAttachments; + /* calendar */ -- (void) setCalendarCategories: (NSArray *) newValues; +- (void)setCalendarCategories : (NSArray *)newValues; - (NSArray *) calendarCategories; - (void) setCalendarCategoriesColors: (NSDictionary *) newValues; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 5e0887ef7..c272ac169 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -959,6 +959,16 @@ NSString *SOGoPasswordRecoverySecondaryEmail = @"SecondaryEmail"; return [self objectForKey: @"SOGoMailLabelsColors"]; } +- (void) setHideInlineAttachments: (BOOL) newValue +{ + [self setBool: newValue forKey: @"SOGoMailHideInlineAttachments"]; +} + +- (BOOL) hideInlineAttachments +{ + return [self boolForKey: @"SOGoMailHideInlineAttachments"]; +} + - (void) setSieveFilters: (NSArray *) newValue { [self setObject: newValue forKey: @"SOGoSieveFilters"]; diff --git a/UI/MailPartViewers/UIxMailPartMixedViewer.m b/UI/MailPartViewers/UIxMailPartMixedViewer.m index 6ae891695..2d2a4889d 100644 --- a/UI/MailPartViewers/UIxMailPartMixedViewer.m +++ b/UI/MailPartViewers/UIxMailPartMixedViewer.m @@ -27,6 +27,8 @@ #import #import +#import + #import #import "UIxMailRenderingContext.h" @@ -98,6 +100,7 @@ NSString *contentType; id viewer, info; NSArray *parts; + SOGoUserDefaults *ud; NSUInteger i, max; @@ -119,14 +122,23 @@ [self setChildInfo: [parts objectAtIndex: i]]; info = [self childInfo]; - viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: info]; - [viewer setBodyInfo: info]; - [viewer setPartPath: [self childPartPath]]; - if ([self decodedFlatContent]) - [viewer setDecodedContent: [parts objectAtIndex: i]]; - [viewer setAttachmentIds: attachmentIds]; + + ud = [[[self context] activeUser] userDefaults]; - [renderedParts addObject: [viewer renderedPart]]; + if (!([info objectForKey:@"disposition"] + && [[info objectForKey:@"disposition"] objectForKey:@"type"] + && [[[info objectForKey:@"disposition"] objectForKey:@"type"] isEqualToString:@"INLINE"] + && [ud hideInlineAttachments])) { + viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: info]; + [viewer setBodyInfo: info]; + [viewer setPartPath: [self childPartPath]]; + if ([self decodedFlatContent]) + [viewer setDecodedContent: [parts objectAtIndex: i]]; + [viewer setAttachmentIds: attachmentIds]; + + + [renderedParts addObject: [viewer renderedPart]]; + } } contentType = [NSString stringWithFormat: @"%@/%@", diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 8d511c694..ce40cb694 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -204,6 +204,7 @@ "Insert signature on new message" = "Insert signature on new message"; "Insert signature on reply" = "Insert signature on reply"; "Insert signature on forward" = "Insert signature on forward"; +"Hide inline attachments" = "Hide inline attachments"; /* Base font size for messages composed in HTML */ "Default font size" = "Default font size"; diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings index 6baef93f4..482f01589 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -204,6 +204,7 @@ "Insert signature on new message" = "Insérer la signature sur un nouveau message"; "Insert signature on reply" = "Insérer la signature sur une réponse"; "Insert signature on forward" = "Insérer la signature sur un transfert"; +"Hide inline attachments" = "Cacher les pièces jointes 'inline'"; /* Base font size for messages composed in HTML */ "Default font size" = "Taille de la police par défaut"; diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 31084163d..253288cdd 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -695,6 +695,16 @@ +
+ + + +
+