mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Disable Mailvelope "sign" message as it can't choose which key
This commit is contained in:
parent
c4ffcc708a
commit
398152be52
6 changed files with 22 additions and 17 deletions
|
|
@ -16,6 +16,7 @@ export const
|
|||
|
||||
Settings = rl.settings,
|
||||
SettingsGet = Settings.get,
|
||||
SettingsCapa = Settings.capa,
|
||||
|
||||
dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 }),
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
|
|||
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
|
||||
|
||||
import { Capa } from 'Common/Enums';
|
||||
import { Settings } from 'Common/Globals';
|
||||
import { SettingsCapa } from 'Common/Globals';
|
||||
|
||||
export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
|
||||
constructor() {
|
||||
|
|
@ -20,7 +20,7 @@ export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
|
|||
this.openpgpkeysPublic = OpenPGPUserStore.publicKeys;
|
||||
this.openpgpkeysPrivate = OpenPGPUserStore.privateKeys;
|
||||
|
||||
this.canOpenPGP = Settings.capa(Capa.OpenPGP);
|
||||
this.canOpenPGP = SettingsCapa(Capa.OpenPGP);
|
||||
this.canGnuPG = GnuPGUserStore.isSupported();
|
||||
this.canMailvelope = !!window.mailvelope;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { Capa } from 'Common/Enums';
|
||||
import { Settings } from 'Common/Globals';
|
||||
import { SettingsCapa } from 'Common/Globals';
|
||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||
|
||||
//import { EmailModel } from 'Model/Email';
|
||||
|
|
@ -34,7 +34,7 @@ export const GnuPGUserStore = new class {
|
|||
this.privateKeys = ko.observableArray();
|
||||
}
|
||||
|
||||
loadKeyrings(/*identifier*/) {
|
||||
loadKeyrings() {
|
||||
this.keyring = null;
|
||||
this.publicKeys([]);
|
||||
this.privateKeys([]);
|
||||
|
|
@ -104,7 +104,7 @@ export const GnuPGUserStore = new class {
|
|||
* @returns {boolean}
|
||||
*/
|
||||
isSupported() {
|
||||
return Settings.capa(Capa.GnuPG);
|
||||
return SettingsCapa(Capa.GnuPG);
|
||||
}
|
||||
|
||||
importKey(key, callback) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Capa } from 'Common/Enums';
|
||||
import { doc, createElement, Settings } from 'Common/Globals';
|
||||
import { doc, createElement, SettingsCapa, SettingsGet } from 'Common/Globals';
|
||||
import { staticLink } from 'Common/Links';
|
||||
|
||||
//import { showScreenPopup } from 'Knoin/Knoin';
|
||||
|
|
@ -17,7 +17,7 @@ export const PgpUserStore = new class {
|
|||
}
|
||||
|
||||
init() {
|
||||
if (Settings.capa(Capa.OpenPGP) && window.crypto && crypto.getRandomValues) {
|
||||
if (SettingsCapa(Capa.OpenPGP) && window.crypto && crypto.getRandomValues) {
|
||||
const script = createElement('script', {src:staticLink('js/min/openpgp.min.js')});
|
||||
script.onload = () => this.loadKeyrings();
|
||||
script.onerror = () => {
|
||||
|
|
@ -31,8 +31,9 @@ export const PgpUserStore = new class {
|
|||
}
|
||||
|
||||
loadKeyrings(identifier) {
|
||||
identifier = identifier || SettingsGet('Email');
|
||||
if (window.mailvelope) {
|
||||
var fn = keyring => {
|
||||
const fn = keyring => {
|
||||
this.mailvelopeKeyring = keyring;
|
||||
console.log('mailvelope ready');
|
||||
};
|
||||
|
|
@ -52,11 +53,11 @@ export const PgpUserStore = new class {
|
|||
}
|
||||
|
||||
if (OpenPGPUserStore.isSupported()) {
|
||||
OpenPGPUserStore.loadKeyrings(identifier);
|
||||
OpenPGPUserStore.loadKeyrings();
|
||||
}
|
||||
|
||||
if (Settings.capa(Capa.GnuPG)) {
|
||||
GnuPGUserStore.loadKeyrings(identifier);
|
||||
if (SettingsCapa(Capa.GnuPG)) {
|
||||
GnuPGUserStore.loadKeyrings();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1540,6 +1540,8 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
case 'M': quota *= 1024; // fallthrough
|
||||
case 'K': quota *= 1024;
|
||||
}
|
||||
// Issue: can't select signing key
|
||||
// this.pgpSign(this.pgpSign() || confirm('Sign this message?'));
|
||||
mailvelope.createEditorContainer('#mailvelope-editor', PgpUserStore.mailvelopeKeyring, {
|
||||
// https://mailvelope.github.io/mailvelope/global.html#EditorContainerOptions
|
||||
quota: Math.max(2048, (quota / 1024)) - 48, // (text + attachments) limit in kilobytes
|
||||
|
|
@ -1550,8 +1552,9 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
quotedMailIndent: true, // if true the quoted mail will be indented (default: true)
|
||||
quotedMailHeader: '', // header to be added before the quoted mail
|
||||
keepAttachments: false, // add attachments of quotedMail to editor (default: false)
|
||||
// Issue: can't select signing key
|
||||
signMsg: this.pgpSign()
|
||||
*/
|
||||
signMsg: this.pgpSign() || confirm('Sign this message?')
|
||||
}).then(editor => this.mailvelope = editor);
|
||||
}
|
||||
this.viewArea('mailvelope');
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@
|
|||
<i class="fontastic" data-bind="text: pgpSign() ? '☑' : '☐'"></i>
|
||||
<span data-i18n="OPENPGP/LABEL_SIGN"></span>
|
||||
</a>
|
||||
<a class="btn" data-bind="click: togglePgpEncrypt, visible: canPgpEncrypt, css: {'btn-success': pgpEncrypt()}">
|
||||
<i class="fontastic" data-bind="text: pgpEncrypt() ? '☑' : '☐'"></i>
|
||||
<a class="btn" data-bind="click: togglePgpEncrypt, visible: canPgpEncrypt, css: {'btn-success': pgpEncrypt() || 'mailvelope' == viewArea()}">
|
||||
<i class="fontastic" data-bind="text: pgpEncrypt() || 'mailvelope' == viewArea() ? '☑' : '☐'"></i>
|
||||
<span data-i18n="OPENPGP/LABEL_ENCRYPT"></span>
|
||||
</a>
|
||||
<a class="btn fontastic" style="padding-left: 10px; padding-right: 10px;" id="composeUploadButton"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue