mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Redesign Raw handling as encodeRawKey/decodeRawKey doesn't need encryption
This commit is contained in:
parent
402de0d569
commit
bd7f9856f2
8 changed files with 73 additions and 115 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { FileInfo, FileType } from 'Common/File';
|
||||
import { stopEvent } from 'Common/Globals';
|
||||
import { stopEvent, SettingsGet, SettingsCapa } from 'Common/Globals';
|
||||
import { b64EncodeJSONSafe } from 'Common/Utils';
|
||||
import {
|
||||
attachmentDownload,
|
||||
serverRequestRaw
|
||||
|
|
@ -23,10 +24,8 @@ export class AttachmentModel extends AbstractModel {
|
|||
this.fileName = '';
|
||||
this.fileNameExt = '';
|
||||
this.fileType = FileType.Unknown;
|
||||
this.isThumbnail = false;
|
||||
this.cId = '';
|
||||
this.contentLocation = '';
|
||||
this.download = '';
|
||||
this.folder = '';
|
||||
this.uid = '';
|
||||
this.url = '';
|
||||
|
|
@ -126,6 +125,17 @@ export class AttachmentModel extends AbstractModel {
|
|||
);
|
||||
}
|
||||
|
||||
get download() {
|
||||
return b64EncodeJSONSafe({
|
||||
folder: this.folder,
|
||||
uid: this.uid,
|
||||
mimeIndex: this.mimeIndex,
|
||||
mimeType: this.mimeType,
|
||||
fileName: this.fileName,
|
||||
accountHash: SettingsGet('accountHash')
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
|
|
@ -144,7 +154,7 @@ export class AttachmentModel extends AbstractModel {
|
|||
* @returns {boolean}
|
||||
*/
|
||||
hasThumbnail() {
|
||||
return this.isThumbnail && !this.isLinked();
|
||||
return SettingsCapa('AttachmentThumbnails') && this.isImage() && !this.isLinked();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue