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,
|
Settings = rl.settings,
|
||||||
SettingsGet = Settings.get,
|
SettingsGet = Settings.get,
|
||||||
|
SettingsCapa = Settings.capa,
|
||||||
|
|
||||||
dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 }),
|
dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 }),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
|
||||||
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
|
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
|
||||||
|
|
||||||
import { Capa } from 'Common/Enums';
|
import { Capa } from 'Common/Enums';
|
||||||
import { Settings } from 'Common/Globals';
|
import { SettingsCapa } from 'Common/Globals';
|
||||||
|
|
||||||
export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
|
export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -20,7 +20,7 @@ export class OpenPgpUserSettings /*extends AbstractViewSettings*/ {
|
||||||
this.openpgpkeysPublic = OpenPGPUserStore.publicKeys;
|
this.openpgpkeysPublic = OpenPGPUserStore.publicKeys;
|
||||||
this.openpgpkeysPrivate = OpenPGPUserStore.privateKeys;
|
this.openpgpkeysPrivate = OpenPGPUserStore.privateKeys;
|
||||||
|
|
||||||
this.canOpenPGP = Settings.capa(Capa.OpenPGP);
|
this.canOpenPGP = SettingsCapa(Capa.OpenPGP);
|
||||||
this.canGnuPG = GnuPGUserStore.isSupported();
|
this.canGnuPG = GnuPGUserStore.isSupported();
|
||||||
this.canMailvelope = !!window.mailvelope;
|
this.canMailvelope = !!window.mailvelope;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import { Capa } from 'Common/Enums';
|
import { Capa } from 'Common/Enums';
|
||||||
import { Settings } from 'Common/Globals';
|
import { SettingsCapa } from 'Common/Globals';
|
||||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||||
|
|
||||||
//import { EmailModel } from 'Model/Email';
|
//import { EmailModel } from 'Model/Email';
|
||||||
|
|
@ -34,7 +34,7 @@ export const GnuPGUserStore = new class {
|
||||||
this.privateKeys = ko.observableArray();
|
this.privateKeys = ko.observableArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadKeyrings(/*identifier*/) {
|
loadKeyrings() {
|
||||||
this.keyring = null;
|
this.keyring = null;
|
||||||
this.publicKeys([]);
|
this.publicKeys([]);
|
||||||
this.privateKeys([]);
|
this.privateKeys([]);
|
||||||
|
|
@ -104,7 +104,7 @@ export const GnuPGUserStore = new class {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isSupported() {
|
isSupported() {
|
||||||
return Settings.capa(Capa.GnuPG);
|
return SettingsCapa(Capa.GnuPG);
|
||||||
}
|
}
|
||||||
|
|
||||||
importKey(key, callback) {
|
importKey(key, callback) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Capa } from 'Common/Enums';
|
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 { staticLink } from 'Common/Links';
|
||||||
|
|
||||||
//import { showScreenPopup } from 'Knoin/Knoin';
|
//import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
@ -17,7 +17,7 @@ export const PgpUserStore = new class {
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
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')});
|
const script = createElement('script', {src:staticLink('js/min/openpgp.min.js')});
|
||||||
script.onload = () => this.loadKeyrings();
|
script.onload = () => this.loadKeyrings();
|
||||||
script.onerror = () => {
|
script.onerror = () => {
|
||||||
|
|
@ -31,11 +31,12 @@ export const PgpUserStore = new class {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadKeyrings(identifier) {
|
loadKeyrings(identifier) {
|
||||||
|
identifier = identifier || SettingsGet('Email');
|
||||||
if (window.mailvelope) {
|
if (window.mailvelope) {
|
||||||
var fn = keyring => {
|
const fn = keyring => {
|
||||||
this.mailvelopeKeyring = keyring;
|
this.mailvelopeKeyring = keyring;
|
||||||
console.log('mailvelope ready');
|
console.log('mailvelope ready');
|
||||||
};
|
};
|
||||||
mailvelope.getKeyring().then(fn, err => {
|
mailvelope.getKeyring().then(fn, err => {
|
||||||
if (identifier) {
|
if (identifier) {
|
||||||
// attempt to create a new keyring for this app/user
|
// attempt to create a new keyring for this app/user
|
||||||
|
|
@ -52,11 +53,11 @@ export const PgpUserStore = new class {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OpenPGPUserStore.isSupported()) {
|
if (OpenPGPUserStore.isSupported()) {
|
||||||
OpenPGPUserStore.loadKeyrings(identifier);
|
OpenPGPUserStore.loadKeyrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Capa.GnuPG)) {
|
if (SettingsCapa(Capa.GnuPG)) {
|
||||||
GnuPGUserStore.loadKeyrings(identifier);
|
GnuPGUserStore.loadKeyrings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1540,6 +1540,8 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
case 'M': quota *= 1024; // fallthrough
|
case 'M': quota *= 1024; // fallthrough
|
||||||
case 'K': quota *= 1024;
|
case 'K': quota *= 1024;
|
||||||
}
|
}
|
||||||
|
// Issue: can't select signing key
|
||||||
|
// this.pgpSign(this.pgpSign() || confirm('Sign this message?'));
|
||||||
mailvelope.createEditorContainer('#mailvelope-editor', PgpUserStore.mailvelopeKeyring, {
|
mailvelope.createEditorContainer('#mailvelope-editor', PgpUserStore.mailvelopeKeyring, {
|
||||||
// https://mailvelope.github.io/mailvelope/global.html#EditorContainerOptions
|
// https://mailvelope.github.io/mailvelope/global.html#EditorContainerOptions
|
||||||
quota: Math.max(2048, (quota / 1024)) - 48, // (text + attachments) limit in kilobytes
|
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)
|
quotedMailIndent: true, // if true the quoted mail will be indented (default: true)
|
||||||
quotedMailHeader: '', // header to be added before the quoted mail
|
quotedMailHeader: '', // header to be added before the quoted mail
|
||||||
keepAttachments: false, // add attachments of quotedMail to editor (default: false)
|
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);
|
}).then(editor => this.mailvelope = editor);
|
||||||
}
|
}
|
||||||
this.viewArea('mailvelope');
|
this.viewArea('mailvelope');
|
||||||
|
|
|
||||||
|
|
@ -142,8 +142,8 @@
|
||||||
<i class="fontastic" data-bind="text: pgpSign() ? '☑' : '☐'"></i>
|
<i class="fontastic" data-bind="text: pgpSign() ? '☑' : '☐'"></i>
|
||||||
<span data-i18n="OPENPGP/LABEL_SIGN"></span>
|
<span data-i18n="OPENPGP/LABEL_SIGN"></span>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn" data-bind="click: togglePgpEncrypt, visible: canPgpEncrypt, css: {'btn-success': pgpEncrypt()}">
|
<a class="btn" data-bind="click: togglePgpEncrypt, visible: canPgpEncrypt, css: {'btn-success': pgpEncrypt() || 'mailvelope' == viewArea()}">
|
||||||
<i class="fontastic" data-bind="text: pgpEncrypt() ? '☑' : '☐'"></i>
|
<i class="fontastic" data-bind="text: pgpEncrypt() || 'mailvelope' == viewArea() ? '☑' : '☐'"></i>
|
||||||
<span data-i18n="OPENPGP/LABEL_ENCRYPT"></span>
|
<span data-i18n="OPENPGP/LABEL_ENCRYPT"></span>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn fontastic" style="padding-left: 10px; padding-right: 10px;" id="composeUploadButton"
|
<a class="btn fontastic" style="padding-left: 10px; padding-right: 10px;" id="composeUploadButton"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue