This commit is contained in:
the-djmaze 2022-12-27 12:19:29 +01:00
parent 871664cd39
commit 5c9fdb6b55
7 changed files with 35 additions and 7 deletions

View file

@ -220,6 +220,10 @@ export class MessageModel extends AbstractModel {
return classes.join(' '); return classes.join(' ');
} }
indent() {
return this.level ? 'margin-left:'+this.level+'em' : null;
}
/** /**
* @returns {string} * @returns {string}
*/ */

View file

@ -264,6 +264,17 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
disableAutoSelect(true); 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(collection);
MessagelistUserStore.isIncomplete(false); MessagelistUserStore.isIncomplete(false);

View file

@ -38,6 +38,13 @@ html.rl-no-preview-pane {
text-transform: capitalize; text-transform: capitalize;
} }
.reply::before {
content: '↳';
line-height: 3;
position: absolute;
margin-left: -1em;
}
.b-footer { .b-footer {
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;

View file

@ -21,7 +21,7 @@ namespace MailSo\Imap\Requests;
class THREAD extends Request class THREAD extends Request
{ {
// ORDEREDSUBJECT or REFERENCES or REFS // ORDEREDSUBJECT or REFERENCES or REFS
public string $sAlgorithm = ''; private string $sAlgorithm = '';
public string $sCriterias = 'ALL'; public string $sCriterias = 'ALL';
@ -41,12 +41,17 @@ class THREAD extends Request
parent::__construct($oImapClient); parent::__construct($oImapClient);
} }
public function SendRequestIterateResponse() : iterable public function setAlgorithm(string $sAlgorithm) : void
{ {
if (!$this->oImapClient->hasCapability(\strtoupper("THREAD={$this->sAlgorithm}"))) { $sAlgorithm = \strtoupper($sAlgorithm);
$this->oImapClient->writeLogException(new \MailSo\RuntimeException("THREAD={$this->sAlgorithm} is not supported"), \LOG_ERR); 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
{
$this->oImapClient->SendRequest( $this->oImapClient->SendRequest(
($this->bUid ? 'UID THREAD' : 'THREAD'), ($this->bUid ? 'UID THREAD' : 'THREAD'),
array( array(

View file

@ -497,6 +497,8 @@ class Message implements \JsonSerializable
'Flags' => $aFlags, 'Flags' => $aFlags,
'InReplyTo' => $this->InReplyTo,
// https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.1 // https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.1
'id' => $this->sEmailId, 'id' => $this->sEmailId,
// 'blobId' => $this->sEmailIdBlob, // 'blobId' => $this->sEmailIdBlob,

View file

@ -141,7 +141,6 @@ trait Response
if (!$sParent) { if (!$sParent) {
$mResult['DraftInfo'] = $mResponse->DraftInfo; $mResult['DraftInfo'] = $mResponse->DraftInfo;
$mResult['InReplyTo'] = $mResponse->InReplyTo;
$mResult['UnsubsribeLinks'] = $mResponse->UnsubsribeLinks; $mResult['UnsubsribeLinks'] = $mResponse->UnsubsribeLinks;
$mResult['References'] = $mResponse->References; $mResult['References'] = $mResponse->References;

View file

@ -156,7 +156,7 @@
<div class="messageListItem" data-bind="css: lineAsCss()"> <div class="messageListItem" data-bind="css: lineAsCss()">
<div class="messageCheckbox"> <div class="messageCheckbox">
<div class="checkboxMessage fontastic" data-bind="text: checked() ? '☑' : '☐'"></div> <div class="checkboxMessage fontastic" data-bind="text: checked() ? '☑' : '☐'"></div>
</div><div> </div><div data-bind="attr:{style:indent()}, css:{reply:indent}">
<div class="flagParent fontastic"></div> <div class="flagParent fontastic"></div>
<div class="senderParent actionHandle" data-bind="attr: {'title': senderClearEmailsString}, text: senderEmailsString"></div> <div class="senderParent actionHandle" data-bind="attr: {'title': senderClearEmailsString}, text: senderEmailsString"></div>
<div class="subjectParent actionHandle" data-bind="text: subject"></div> <div class="subjectParent actionHandle" data-bind="text: subject"></div>