mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Threaded view changes for https://github.com/the-djmaze/snappymail/issues/445#issuecomment-1364575843
This commit is contained in:
parent
871664cd39
commit
5c9fdb6b55
7 changed files with 35 additions and 7 deletions
|
|
@ -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}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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 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
|
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->oImapClient->SendRequest(
|
||||||
($this->bUid ? 'UID THREAD' : 'THREAD'),
|
($this->bUid ? 'UID THREAD' : 'THREAD'),
|
||||||
array(
|
array(
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue