mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-28 14:55:48 +00:00
Move Autocrypt parsing to JavaScript
This commit is contained in:
@@ -74,7 +74,7 @@ export class MessageModel extends AbstractModel {
|
||||
this.messageId = '';
|
||||
this.inReplyTo = '';
|
||||
this.references = '';
|
||||
this.autocrypt = {};
|
||||
this.autocrypt = {/*addr:'', 'prefer-encrypt':'nopreference', keydata:'BASE64'*/};
|
||||
|
||||
addObservablesTo(this, {
|
||||
subject: '',
|
||||
@@ -277,8 +277,15 @@ export class MessageModel extends AbstractModel {
|
||||
if (value = headers.valueByName('X-Virus-Scanned')) {
|
||||
this.virusScanned(value);
|
||||
}
|
||||
*/
|
||||
|
||||
// https://autocrypt.org/level1.html#the-autocrypt-header
|
||||
if (value = headers.valueByName('Autocrypt')) {
|
||||
value.split(';').forEach(entry => {
|
||||
entry = entry.trim().split('=', 2);
|
||||
json.autocrypt[entry[0]] = entry[1];
|
||||
});
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,9 +42,7 @@ class Message implements \JsonSerializable
|
||||
/**
|
||||
* https://www.rfc-editor.org/rfc/rfc8970
|
||||
*/
|
||||
$sPreview = null,
|
||||
// https://autocrypt.org/level1.html#the-autocrypt-header
|
||||
$sAutocrypt = '';
|
||||
$sPreview = null;
|
||||
|
||||
private int
|
||||
$Uid = 0,
|
||||
@@ -291,8 +289,6 @@ class Message implements \JsonSerializable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oMessage->sAutocrypt = $oHeaders->ValueByName(MimeHeader::AUTOCRYPT);
|
||||
}
|
||||
else if ($oFetchResponse->GetEnvelope())
|
||||
{
|
||||
@@ -466,14 +462,6 @@ class Message implements \JsonSerializable
|
||||
$this->aFlagsLowerCase
|
||||
), true);
|
||||
*/
|
||||
$aAutocrypt = [];
|
||||
if ($this->sAutocrypt) {
|
||||
foreach (\explode(';', $this->sAutocrypt) as $entry) {
|
||||
$entry = \explode('=', \trim($entry), 2);
|
||||
$aAutocrypt[$entry[0]] = $entry[1];
|
||||
}
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'@Object' => 'Object/Message',
|
||||
'folder' => $this->sFolder,
|
||||
@@ -498,7 +486,6 @@ class Message implements \JsonSerializable
|
||||
'deliveredTo' => $this->oDeliveredTo,
|
||||
|
||||
'readReceipt' => $this->ReadReceipt,
|
||||
'autocrypt' => $aAutocrypt ?: null,
|
||||
|
||||
'attachments' => $this->Attachments,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user