diff --git a/dev/Model/Message.js b/dev/Model/Message.js index c7808dfa9..7afd6fcbe 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -220,6 +220,10 @@ export class MessageModel extends AbstractModel { return classes.join(' '); } + indent() { + return this.level ? 'margin-left:'+this.level+'em' : null; + } + /** * @returns {string} */ diff --git a/dev/Stores/User/Messagelist.js b/dev/Stores/User/Messagelist.js index 3bf21945d..6bf341a9b 100644 --- a/dev/Stores/User/Messagelist.js +++ b/dev/Stores/User/Messagelist.js @@ -264,6 +264,17 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach disableAutoSelect(true); + if (collection.ThreadUid) { + let refs = {}; + collection.forEach(msg => { + msg.level = 0; + if (msg.inReplyTo && refs[msg.inReplyTo]) { + msg.level = 1 + refs[msg.inReplyTo].level; + } + refs[msg.messageId] = msg; + }); + } + MessagelistUserStore(collection); MessagelistUserStore.isIncomplete(false); diff --git a/dev/Styles/User/MessageList.less b/dev/Styles/User/MessageList.less index 57b79f9f4..7026f6b5f 100644 --- a/dev/Styles/User/MessageList.less +++ b/dev/Styles/User/MessageList.less @@ -38,6 +38,13 @@ html.rl-no-preview-pane { text-transform: capitalize; } + .reply::before { + content: '↳'; + line-height: 3; + position: absolute; + margin-left: -1em; + } + .b-footer { display: flex; flex-shrink: 0; diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Requests/THREAD.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Requests/THREAD.php index 9cc5314e5..9175c087b 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Requests/THREAD.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Requests/THREAD.php @@ -21,7 +21,7 @@ namespace MailSo\Imap\Requests; class THREAD extends Request { // ORDEREDSUBJECT or REFERENCES or REFS - public string $sAlgorithm = ''; + private string $sAlgorithm = ''; public string $sCriterias = 'ALL'; @@ -41,12 +41,17 @@ class THREAD extends Request parent::__construct($oImapClient); } + public function setAlgorithm(string $sAlgorithm) : void + { + $sAlgorithm = \strtoupper($sAlgorithm); + if (!$this->oImapClient->hasCapability("THREAD={$sAlgorithm}")) { + $this->oImapClient->writeLogException(new \MailSo\RuntimeException("THREAD={$sAlgorithm} is not supported"), \LOG_ERR); + } + $this->sAlgorithm = $sAlgorithm; + } + public function SendRequestIterateResponse() : iterable { - if (!$this->oImapClient->hasCapability(\strtoupper("THREAD={$this->sAlgorithm}"))) { - $this->oImapClient->writeLogException(new \MailSo\RuntimeException("THREAD={$this->sAlgorithm} is not supported"), \LOG_ERR); - } - $this->oImapClient->SendRequest( ($this->bUid ? 'UID THREAD' : 'THREAD'), array( diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php index c5d1233fc..021d4aba4 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php @@ -497,6 +497,8 @@ class Message implements \JsonSerializable 'Flags' => $aFlags, + 'InReplyTo' => $this->InReplyTo, + // https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.1 'id' => $this->sEmailId, // 'blobId' => $this->sEmailIdBlob, diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php index 26e0f06c7..2598bd64e 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php @@ -141,7 +141,6 @@ trait Response if (!$sParent) { $mResult['DraftInfo'] = $mResponse->DraftInfo; - $mResult['InReplyTo'] = $mResponse->InReplyTo; $mResult['UnsubsribeLinks'] = $mResponse->UnsubsribeLinks; $mResult['References'] = $mResponse->References; diff --git a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html index 16c721901..636f20b96 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html @@ -156,7 +156,7 @@
-
+