From a916ac892703c45fc1c4d720e7baf73c747d45d7 Mon Sep 17 00:00:00 2001 From: Luc Charland Date: Fri, 26 Oct 2012 13:39:28 -0400 Subject: [PATCH] Fixed bug #1105 Remote images display There now is a configurable default in mail preferences where you can set remote images to display either Never or Always. --- SoObjects/SOGo/SOGoUserDefaults.h | 3 +++ SoObjects/SOGo/SOGoUserDefaults.m | 10 +++++++++ .../English.lproj/Localizable.strings | 2 ++ UI/PreferencesUI/UIxPreferences.m | 22 +++++++++++++++++++ UI/Templates/MailerUI/UIxMailMainFrame.wox | 2 +- UI/Templates/PreferencesUI/UIxPreferences.wox | 6 +++++ UI/WebServerResources/MailerUI.js | 14 +++++++++--- 7 files changed, 55 insertions(+), 4 deletions(-) diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index d8b56ef0a..0a6cdb818 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -118,6 +118,9 @@ extern NSString *SOGoWeekStartFirstFullWeek; - (void) setMailComposeMessageType: (NSString *) newValue; - (NSString *) mailComposeMessageType; +- (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; +- (NSString *) mailDisplayRemoteInlineImages; + - (void) setMailMessageForwarding: (NSString *) newValue; - (NSString *) mailMessageForwarding; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 6d05afbba..81f6cada8 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -493,6 +493,16 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; return [self stringForKey: @"SOGoMailComposeMessageType"]; } +- (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; +{ + [self setObject: newValue forKey: @"SOGoMailDisplayRemoteInlineImages"]; +} + +- (NSString *) mailDisplayRemoteInlineImages; +{ + return [self stringForKey: @"SOGoMailDisplayRemoteInlineImages"]; +} + - (void) setMailMessageForwarding: (NSString *) newValue { [self setObject: newValue forKey: @"SOGoMailMessageForwarding"]; diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index b807a9129..04cbd629c 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -149,6 +149,8 @@ "Compose messages in" = "Compose messages in"; "composemessagestype_html" = "HTML"; "composemessagestype_text" = "Plain text"; +"displayremoteinlineimages_never" = "Never"; +"displayremoteinlineimages_always" = "Always"; /* IMAP Accounts */ "New Mail Account" = "New Mail Account"; diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index d3473ae71..8d6bcb227 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -759,6 +759,28 @@ [userDefaults setMailComposeMessageType: newType]; } +/* Display remote inline images */ +- (NSArray *) displayRemoteInlineImages +{ + return [NSArray arrayWithObjects: @"never", @"always", nil]; +} + +- (NSString *) itemDisplayRemoteInlineImagesText +{ + return [self labelForKey: [NSString stringWithFormat: + @"displayremoteinlineimages_%@", item]]; +} + +- (NSString *) userDisplayRemoteInlineImages +{ + return [userDefaults mailDisplayRemoteInlineImages]; +} + +- (void) setUserDisplayRemoteInlineImages: (NSString *) newType +{ + [userDefaults setMailDisplayRemoteInlineImages: newType]; +} + /* mail autoreply (vacation) */ - (BOOL) isSieveScriptsEnabled diff --git a/UI/Templates/MailerUI/UIxMailMainFrame.wox b/UI/Templates/MailerUI/UIxMailMainFrame.wox index 30c93a901..c0438bb64 100644 --- a/UI/Templates/MailerUI/UIxMailMainFrame.wox +++ b/UI/Templates/MailerUI/UIxMailMainFrame.wox @@ -7,7 +7,7 @@ xmlns:label="OGo:label" className="UIxPageFrame" title="title" - const:userDefaultsKeys="SOGoMailMessageCheck,SOGoMailSortByThreads,SOGoMailListViewColumnsOrder" + const:userDefaultsKeys="SOGoMailMessageCheck,SOGoMailSortByThreads,SOGoMailListViewColumnsOrder,SOGoMailDisplayRemoteInlineImages" const:userSettingsKeys="Mail" const:jsFiles="dtree.js,MailerUIdTree.js,SOGoAutoCompletion.js,SOGoResizableTable.js,SOGoMailDataSource.js,SOGoDataTable.js,jquery-ui.js">