mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Use JMAP rfc8621 section-4 subject and receivedAt
This commit is contained in:
parent
118505f91e
commit
a43fadb4e8
7 changed files with 14 additions and 10 deletions
|
|
@ -134,7 +134,7 @@ MessagelistUserStore.initUidNextAndNewMessages = (folder, uidNext, newMessages)
|
||||||
newMessages.forEach(item => {
|
newMessages.forEach(item => {
|
||||||
NotificationUserStore.displayDesktopNotification(
|
NotificationUserStore.displayDesktopNotification(
|
||||||
EmailCollectionModel.reviveFromJson(item.From).toString(),
|
EmailCollectionModel.reviveFromJson(item.From).toString(),
|
||||||
item.Subject,
|
item.subject,
|
||||||
{ Folder: item.Folder, Uid: item.Uid }
|
{ Folder: item.Folder, Uid: item.Uid }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
Cc: this.cc(),
|
Cc: this.cc(),
|
||||||
Bcc: this.bcc(),
|
Bcc: this.bcc(),
|
||||||
ReplyTo: this.replyTo(),
|
ReplyTo: this.replyTo(),
|
||||||
Subject: this.subject(),
|
subject: this.subject(),
|
||||||
DraftInfo: this.aDraftInfo,
|
DraftInfo: this.aDraftInfo,
|
||||||
InReplyTo: this.sInReplyTo,
|
InReplyTo: this.sInReplyTo,
|
||||||
References: this.sReferences,
|
References: this.sReferences,
|
||||||
|
|
|
||||||
|
|
@ -575,7 +575,7 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
MessageFolder: oMessage.folder,
|
MessageFolder: oMessage.folder,
|
||||||
MessageUid: oMessage.uid,
|
MessageUid: oMessage.uid,
|
||||||
ReadReceipt: oMessage.readReceipt(),
|
ReadReceipt: oMessage.readReceipt(),
|
||||||
Subject: i18n('READ_RECEIPT/SUBJECT', { SUBJECT: oMessage.subject() }),
|
subject: i18n('READ_RECEIPT/SUBJECT', { SUBJECT: oMessage.subject() }),
|
||||||
Text: i18n('READ_RECEIPT/BODY', { 'READ-RECEIPT': AccountUserStore.email() })
|
Text: i18n('READ_RECEIPT/BODY', { 'READ-RECEIPT': AccountUserStore.email() })
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -504,7 +504,7 @@ class MailClient
|
||||||
$aNewMessages[] = array(
|
$aNewMessages[] = array(
|
||||||
'Folder' => $sFolderName,
|
'Folder' => $sFolderName,
|
||||||
'Uid' => $iUid,
|
'Uid' => $iUid,
|
||||||
'Subject' => $oHeaders->ValueByName(MimeHeader::SUBJECT, !$sContentTypeCharset),
|
'subject' => $oHeaders->ValueByName(MimeHeader::SUBJECT, !$sContentTypeCharset),
|
||||||
'From' => $oHeaders->GetAsEmailCollection(MimeHeader::FROM_, !$sContentTypeCharset)
|
'From' => $oHeaders->GetAsEmailCollection(MimeHeader::FROM_, !$sContentTypeCharset)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -632,9 +632,8 @@ class Message implements \JsonSerializable
|
||||||
'@Object' => 'Object/Message',
|
'@Object' => 'Object/Message',
|
||||||
'Folder' => $this->sFolder,
|
'Folder' => $this->sFolder,
|
||||||
'Uid' => $this->iUid,
|
'Uid' => $this->iUid,
|
||||||
'Subject' => \trim(Utils::Utf8Clear($this->sSubject)),
|
'subject' => \trim(Utils::Utf8Clear($this->sSubject)),
|
||||||
'MessageId' => $this->sMessageId,
|
'MessageId' => $this->sMessageId,
|
||||||
'Size' => $this->iSize,
|
|
||||||
'SpamScore' => $this->bIsSpam ? 100 : $this->iSpamScore,
|
'SpamScore' => $this->bIsSpam ? 100 : $this->iSpamScore,
|
||||||
'SpamResult' => $this->sSpamResult,
|
'SpamResult' => $this->sSpamResult,
|
||||||
'IsSpam' => $this->bIsSpam,
|
'IsSpam' => $this->bIsSpam,
|
||||||
|
|
@ -658,7 +657,12 @@ class Message implements \JsonSerializable
|
||||||
|
|
||||||
'Attachments' => $this->oAttachments ? $this->oAttachments->SpecData() : null,
|
'Attachments' => $this->oAttachments ? $this->oAttachments->SpecData() : null,
|
||||||
|
|
||||||
'Flags' => $this->aFlagsLowerCase
|
'Flags' => $this->aFlagsLowerCase,
|
||||||
|
|
||||||
|
// https://datatracker.ietf.org/doc/html/rfc8621#section-4.1.1
|
||||||
|
'size' => $this->iSize,
|
||||||
|
'receivedAt' => \gmdate('Y-m-d\\TH:i:s\\Z', $this->iInternalTimeStampInUTC)
|
||||||
|
// 'keywords' => \array_fill_keys($this->aFlagsLowerCase, true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -982,7 +982,7 @@ trait Messages
|
||||||
private function buildReadReceiptMessage(Account $oAccount) : \MailSo\Mime\Message
|
private function buildReadReceiptMessage(Account $oAccount) : \MailSo\Mime\Message
|
||||||
{
|
{
|
||||||
$sReadReceipt = $this->GetActionParam('ReadReceipt', '');
|
$sReadReceipt = $this->GetActionParam('ReadReceipt', '');
|
||||||
$sSubject = $this->GetActionParam('Subject', '');
|
$sSubject = $this->GetActionParam('subject', '');
|
||||||
$sText = $this->GetActionParam('Text', '');
|
$sText = $this->GetActionParam('Text', '');
|
||||||
|
|
||||||
$oIdentity = $this->GetIdentityByID($oAccount, '', true);
|
$oIdentity = $this->GetIdentityByID($oAccount, '', true);
|
||||||
|
|
@ -1084,7 +1084,7 @@ trait Messages
|
||||||
$oMessage->SetPriority(\MailSo\Mime\Enumerations\MessagePriority::HIGH);
|
$oMessage->SetPriority(\MailSo\Mime\Enumerations\MessagePriority::HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
$oMessage->SetSubject($this->GetActionParam('Subject', ''));
|
$oMessage->SetSubject($this->GetActionParam('subject', ''));
|
||||||
|
|
||||||
$oToEmails = new \MailSo\Mime\EmailCollection($this->GetActionParam('To', ''));
|
$oToEmails = new \MailSo\Mime\EmailCollection($this->GetActionParam('To', ''));
|
||||||
if ($oToEmails->count()) {
|
if ($oToEmails->count()) {
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ trait Response
|
||||||
$mResult[$prop] = $this->responseObject($mResult[$prop], $sParent);
|
$mResult[$prop] = $this->responseObject($mResult[$prop], $sParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sSubject = $mResult['Subject'];
|
$sSubject = $mResult['subject'];
|
||||||
$mResult['Hash'] = \md5($mResult['Folder'].$mResult['Uid']);
|
$mResult['Hash'] = \md5($mResult['Folder'].$mResult['Uid']);
|
||||||
$mResult['RequestHash'] = Utils::EncodeKeyValuesQ(array(
|
$mResult['RequestHash'] = Utils::EncodeKeyValuesQ(array(
|
||||||
'V' => APP_VERSION,
|
'V' => APP_VERSION,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue