feat(mail): Add a setting to show the attachments above the mail body

This commit is contained in:
Hivert Quentin
2025-09-19 15:30:45 +02:00
parent a077512e34
commit 5d616600df
9 changed files with 39 additions and 6 deletions

View File

@@ -129,6 +129,7 @@
SOGoMailDisplayFullEmail = NO;
SOGoMailDisplayRemoteInlineImages = "never";
SOGoMailCertificateEnabled = YES;
SOGoMailDisplayAttachmentAbove = NO;
SOGoMailAutoMarkAsReadDelay = "0";
SOGoMailAutoSave = "5";

View File

@@ -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;

View File

@@ -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"];

View File

@@ -114,7 +114,7 @@ See <a href=\"http://www.sogo.nu/en/support/community.html\">this page</a> 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";

View File

@@ -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";

View File

@@ -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";

View File

@@ -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"];

View File

@@ -721,6 +721,16 @@
</md-checkbox>
</div>
<div>
<md-checkbox
ng-model="app.preferences.defaults.SOGoMailDisplayAttachmentAbove"
ng-true-value="1"
ng-false-value="0"
label:aria-label="Show attachments above the message">
<var:string label:value="Show attachments above the message"/>
</md-checkbox>
</div>
<div>
<md-checkbox
ng-model="app.preferences.defaults.SOGoMailAutoMarkAsReadEnabled"

View File

@@ -462,7 +462,12 @@
// Trusted content that can be compiled (Angularly-speaking)
part.compile = true;
if (!Object.hasOwn(part, 'shouldDisplayAttachment') || 1 == part.shouldDisplayAttachment ) {
parts.push(part);
if(Message.$Preferences.defaults.SOGoMailDisplayAttachmentAbove) {
parts.unshift(part);
}
else {
parts.push(part);
}
}
}
else {