Improved autocrypt #342

This commit is contained in:
the-djmaze 2023-02-07 15:25:28 +01:00
parent 636ffe5fbb
commit 05d8e7b353
3 changed files with 12 additions and 2 deletions

View file

@ -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: '',

View file

@ -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:

View file

@ -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,