From 8ab32816e2ac82be9c897c5e5487f960ef2b3b2a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 12 Feb 2024 02:13:39 +0100 Subject: [PATCH] Resolve #1404 --- dev/Model/Identity.js | 1 + dev/Styles/User/Identity.less | 2 +- dev/View/Popup/Compose.js | 2 +- dev/View/Popup/Identity.js | 13 +++++- .../app/libraries/RainLoop/Model/Identity.php | 13 ++++-- .../templates/Views/User/PopupsIdentity.html | 44 +++++++++++-------- 6 files changed, 50 insertions(+), 25 deletions(-) diff --git a/dev/Model/Identity.js b/dev/Model/Identity.js index 592650e07..78039eb62 100644 --- a/dev/Model/Identity.js +++ b/dev/Model/Identity.js @@ -17,6 +17,7 @@ export class IdentityModel extends AbstractModel { replyTo: '', bcc: '', + sentFolder: '', signature: '', signatureInsertBefore: false, diff --git a/dev/Styles/User/Identity.less b/dev/Styles/User/Identity.less index bdcd7e917..4458c40ed 100644 --- a/dev/Styles/User/Identity.less +++ b/dev/Styles/User/Identity.less @@ -3,7 +3,7 @@ max-width: 770px; .tab-content { - grid-column-end: 4; + grid-column-end: 5; padding-top: 20px; } diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index c53617985..9c5f63415 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -457,7 +457,7 @@ export class ComposePopupView extends AbstractViewPopup { } sendCommand() { - let sSentFolder = FolderUserStore.sentFolder(); + let sSentFolder = this.currentIdentity()?.sentFolder || FolderUserStore.sentFolder(); this.attachmentsInProcessError(false); this.attachmentsInErrorError(false); diff --git a/dev/View/Popup/Identity.js b/dev/View/Popup/Identity.js index 0857a78ab..5b2405e59 100644 --- a/dev/View/Popup/Identity.js +++ b/dev/View/Popup/Identity.js @@ -1,5 +1,5 @@ -import { addObservablesTo } from 'External/ko'; +import { addObservablesTo, koComputable } from 'External/ko'; import { getNotification } from 'Common/Translator'; import { loadAccountsAndIdentities } from 'Common/UtilsUser'; @@ -10,6 +10,10 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; import { IdentityModel } from 'Model/Identity'; +import { folderListOptionsBuilder } from 'Common/Folders'; +import { i18n } from 'Common/Translator'; +import { defaultOptionsAfterRender } from 'Common/Utils'; + export class IdentityPopupView extends AbstractViewPopup { constructor() { super('Identity'); @@ -27,6 +31,13 @@ export class IdentityPopupView extends AbstractViewPopup { this.replyTo.valueHasMutated(); this.bcc.valueHasMutated(); */ + this.folderSelectList = koComputable(() => + folderListOptionsBuilder( + [], + [['', '('+i18n('GLOBAL/DEFAULT')+')']] + ) + ); + this.defaultOptionsAfterRender = defaultOptionsAfterRender; } submitForm(form) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Identity.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Identity.php index 02ea3c1d7..e378dc903 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Identity.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Model/Identity.php @@ -20,6 +20,8 @@ class Identity implements \JsonSerializable private string $sSignature = ''; + private string $sSentFolder = ''; + private bool $bSignatureInsertBefore = false; private bool $bPgpEncrypt = false; @@ -92,8 +94,9 @@ class Identity implements \JsonSerializable $this->sBcc = !empty($aData['Bcc']) ? $aData['Bcc'] : ''; $this->sSignature = !empty($aData['Signature']) ? $aData['Signature'] : ''; $this->bSignatureInsertBefore = !empty($aData['SignatureInsertBefore']); - $this->bPgpEncrypt = !empty($aData['PgpEncrypt']); - $this->bPgpSign = !empty($aData['PgpSign']); + $this->sSentFolder = isset($aData['sentFolder']) ? $aData['sentFolder'] : ''; + $this->bPgpEncrypt = !empty($aData['pgpEncrypt']); + $this->bPgpSign = !empty($aData['pgpSign']); return true; } @@ -112,8 +115,9 @@ class Identity implements \JsonSerializable 'Bcc' => $this->sBcc, 'Signature' => $this->sSignature, 'SignatureInsertBefore' => $this->bSignatureInsertBefore, - 'PgpEncrypt' => $this->bPgpEncrypt, - 'PgpSign' => $this->bPgpSign + 'sentFolder' => $this->sSentFolder, + 'pgpEncrypt' => $this->bPgpEncrypt, + 'pgpSign' => $this->bPgpSign ); } @@ -130,6 +134,7 @@ class Identity implements \JsonSerializable 'bcc' => $this->sBcc, 'signature' => $this->sSignature, 'signatureInsertBefore' => $this->bSignatureInsertBefore, + 'sentFolder' => $this->sSentFolder, 'pgpEncrypt' => $this->bPgpEncrypt, 'pgpSign' => $this->bPgpSign ); diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsIdentity.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsIdentity.html index 7cf85a3ab..d634bd174 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsIdentity.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsIdentity.html @@ -52,29 +52,15 @@ }"> - - + +