mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-19 13:18:59 +08:00
Improved autocrypt #342
This commit is contained in:
parent
636ffe5fbb
commit
05d8e7b353
3 changed files with 12 additions and 2 deletions
|
@ -75,6 +75,7 @@ export class MessageModel extends AbstractModel {
|
|||
this.messageId = '';
|
||||
this.inReplyTo = '';
|
||||
this.references = '';
|
||||
this.autocrypt = {};
|
||||
|
||||
addObservablesTo(this, {
|
||||
subject: '',
|
||||
|
@ -111,7 +112,6 @@ export class MessageModel extends AbstractModel {
|
|||
|
||||
readReceipt: '',
|
||||
|
||||
autocrypt: '',
|
||||
// rfc8621
|
||||
id: '',
|
||||
// threadId: '',
|
||||
|
|
|
@ -840,6 +840,8 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
this.aDraftInfo = ['reply', message.uid, message.folder];
|
||||
this.sInReplyTo = message.messageId;
|
||||
this.sReferences = (message.messageId + ' ' + message.references).trim();
|
||||
// OpenPGP “Transferable Public Key”
|
||||
// message.autocrypt?.keydata
|
||||
break;
|
||||
|
||||
case ComposeType.Forward:
|
||||
|
|
|
@ -485,6 +485,14 @@ class Message implements \JsonSerializable
|
|||
$this->aFlagsLowerCase
|
||||
));
|
||||
|
||||
$aAutocrypt = [];
|
||||
if ($this->sAutocrypt) {
|
||||
foreach (\explode(';', $this->sAutocrypt) as $entry) {
|
||||
$entry = \explode('=', \trim($entry), 2);
|
||||
$aAutocrypt[$entry[0]] = $entry[1];
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'@Object' => 'Object/Message',
|
||||
'folder' => $this->sFolder,
|
||||
|
@ -512,7 +520,7 @@ class Message implements \JsonSerializable
|
|||
'threads' => $this->aThreads,
|
||||
'unsubsribeLinks' => $this->UnsubsribeLinks,
|
||||
'readReceipt' => '',
|
||||
'autocrypt' => $this->sAutocrypt,
|
||||
'autocrypt' => $aAutocrypt ?: null,
|
||||
|
||||
'attachments' => $this->Attachments,
|
||||
|
||||
|
|
Loading…
Reference in a new issue