From 5d616600dfa6258e4eebcb5c065e393ebfae8f3a Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Fri, 19 Sep 2025 15:30:45 +0200 Subject: [PATCH] feat(mail): Add a setting to show the attachments above the mail body --- SoObjects/SOGo/SOGoDefaults.plist | 1 + SoObjects/SOGo/SOGoUserDefaults.h | 6 ++++-- SoObjects/SOGo/SOGoUserDefaults.m | 14 ++++++++++++-- UI/MainUI/English.lproj/Localizable.strings | 2 +- UI/PreferencesUI/English.lproj/Localizable.strings | 1 + UI/PreferencesUI/French.lproj/Localizable.strings | 1 + UI/PreferencesUI/UIxJSONPreferences.m | 3 +++ UI/Templates/PreferencesUI/UIxPreferences.wox | 10 ++++++++++ UI/WebServerResources/js/Mailer/Message.service.js | 7 ++++++- 9 files changed, 39 insertions(+), 6 deletions(-) diff --git a/SoObjects/SOGo/SOGoDefaults.plist b/SoObjects/SOGo/SOGoDefaults.plist index dfc38cdd2..14467bbdc 100644 --- a/SoObjects/SOGo/SOGoDefaults.plist +++ b/SoObjects/SOGo/SOGoDefaults.plist @@ -129,6 +129,7 @@ SOGoMailDisplayFullEmail = NO; SOGoMailDisplayRemoteInlineImages = "never"; SOGoMailCertificateEnabled = YES; + SOGoMailDisplayAttachmentAbove = NO; SOGoMailAutoMarkAsReadDelay = "0"; SOGoMailAutoSave = "5"; diff --git a/SoObjects/SOGo/SOGoUserDefaults.h b/SoObjects/SOGo/SOGoUserDefaults.h index cd698f4d8..97a65518d 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.h +++ b/SoObjects/SOGo/SOGoUserDefaults.h @@ -156,12 +156,14 @@ extern NSString *SOGoPasswordRecoverySecondaryEmail; - (void) setMailComposeFontSize: (int) newValue; - (int) mailComposeFontSize; -- (void) setMailDisplayFullEmail: (BOOL *) newValue; -- (BOOL *) mailDisplayFullEmail; +- (void) setMailDisplayFullEmail: (BOOL) newValue; +- (BOOL) mailDisplayFullEmail; - (void) setMailDisplayRemoteInlineImages: (NSString *) newValue; - (NSString *) mailDisplayRemoteInlineImages; +- (void) setMailDisplayAttachmentAbove: (BOOL) newValue; +- (BOOL) mailDisplayAttachmentAbove; - (void) setMailAutoMarkAsReadDelay: (int) newValue; - (int) mailAutoMarkAsReadDelay; diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index d6ed90773..9ff37e9a4 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -634,12 +634,12 @@ NSString *SOGoPasswordRecoverySecondaryEmail = @"SecondaryEmail"; return [self integerForKey: @"SOGoMailComposeFontSize"]; } -- (void) setMailDisplayFullEmail: (BOOL *) newValue +- (void) setMailDisplayFullEmail: (BOOL) newValue { [self setBool: newValue forKey: @"SOGoMailDisplayFullEmail"]; } -- (BOOL *) mailDisplayFullEmail; +- (BOOL) mailDisplayFullEmail; { return [self boolForKey: @"SOGoMailDisplayFullEmail"]; } @@ -654,6 +654,16 @@ NSString *SOGoPasswordRecoverySecondaryEmail = @"SecondaryEmail"; return [self stringForKey: @"SOGoMailDisplayRemoteInlineImages"]; } +- (void) setMailDisplayAttachmentAbove: (BOOL) newValue +{ + [self setBool: newValue forKey: @"SOGoMailDisplayAttachmentAbove"]; +} + +- (BOOL) mailDisplayAttachmentAbove; +{ + return [self boolForKey: @"SOGoMailDisplayAttachmentAbove"]; +} + - (void) setMailAutoMarkAsReadDelay: (int) newValue { [self setInteger: newValue forKey: @"SOGoMailAutoMarkAsReadDelay"]; diff --git a/UI/MainUI/English.lproj/Localizable.strings b/UI/MainUI/English.lproj/Localizable.strings index 3089d6b3a..86a8008f8 100644 --- a/UI/MainUI/English.lproj/Localizable.strings +++ b/UI/MainUI/English.lproj/Localizable.strings @@ -114,7 +114,7 @@ See this page for v "New password" = "New password"; "Passwords don't match" = "Passwords don't match"; "Confirmation" = "Confirmation"; -"Change" = "Changer"; +"Change" = "Change"; "Cancel" = "Cancel"; "Please wait..." = "Please wait..."; "Close" = "Close"; diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 6110d5285..b17b7502d 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -207,6 +207,7 @@ "Insert signature on forward" = "Insert signature on forward"; "Show recipients or sender full email in mailboxes" = "Show recipients or sender full email in mailboxes"; "Hide attachements for inline images" = "Hide attachments for inline images"; +"Show attachments above the message" = "Show attachments above the message"; /* 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 72e7b4775..44e3ccc55 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -207,6 +207,7 @@ "Insert signature on forward" = "Insérer la signature sur un transfert"; "Show recipients or sender full email in mailboxes" = "Afficher l'email complet du destinataire ou expéditeur dans les boîtes aux lettres"; "Hide attachements for inline images" = "Cacher les pièces jointes pour les images 'inline'"; +"Show attachments above the message" = "Montrer les pièces jointes au dessus du message"; /* Base font size for messages composed in HTML */ "Default font size" = "Taille de la police par défaut"; diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index 4c81ba2cf..8fb6f0cef 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -429,6 +429,9 @@ static SoProduct *preferencesProduct = nil; if (![[defaults source] objectForKey: @"SOGoMailDisplayRemoteInlineImages"]) [[defaults source] setObject: [defaults mailDisplayRemoteInlineImages] forKey: @"SOGoMailDisplayRemoteInlineImages"]; + if (![[defaults source] objectForKey: @"SOGoMailDisplayAttachmentAbove"]) + [[defaults source] setObject: [defaults mailDisplayAttachmentAbove] forKey: @"SOGoMailDisplayAttachmentAbove"]; + if ([[defaults source] objectForKey: @"SOGoMailAutoMarkAsReadDelay"] == nil) [[defaults source] setObject: [NSNumber numberWithInt: [defaults mailAutoMarkAsReadDelay]] forKey: @"SOGoMailAutoMarkAsReadDelay"]; diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 97be263d7..cfd7ca5cc 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -721,6 +721,16 @@ +
+ + + +
+