diff --git a/mail/base/content/about3Pane.js b/mail/base/content/about3Pane.js index b5fe5edd71..693bbf61c2 100644 --- a/mail/base/content/about3Pane.js +++ b/mail/base/content/about3Pane.js @@ -295,11 +295,11 @@ window.addEventListener("DOMContentLoaded", event => { } if (gFolder.isSpecialFolder(Ci.nsMsgFolderFlags.Drafts, true)) { - commandController.doCommand("cmd_editDraftMsg"); + commandController.doCommand("cmd_editDraftMsg", event); } else if (gFolder.isSpecialFolder(Ci.nsMsgFolderFlags.Templates, true)) { - commandController.doCommand("cmd_newMsgFromTemplate"); + commandController.doCommand("cmd_newMsgFromTemplate", event); } else { - commandController.doCommand("cmd_openMessage"); + commandController.doCommand("cmd_openMessage", event); } }); diff --git a/mail/base/content/aboutMessage.js b/mail/base/content/aboutMessage.js index 207ce8ece6..8a51adffb7 100644 --- a/mail/base/content/aboutMessage.js +++ b/mail/base/content/aboutMessage.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at http://mozilla.org/MPL/2.0/. */ -/* globals MailE10SUtils */ +/* globals Enigmail, MailE10SUtils */ // mailCommon.js /* globals commandController, dbViewWrapperListener */ @@ -126,6 +126,9 @@ window.addEventListener("DOMContentLoaded", event => { content = document.querySelector("browser"); OnLoadMsgHeaderPane(); + Enigmail.msg.messengerStartup(); + Enigmail.hdrView.hdrViewLoad(); + // The folder listener only does something interesting if this is a // standalone window or tab, so don't add it if we're inside about:3pane. if (window.browsingContext.parent.currentURI.spec != "about:3pane") { diff --git a/mail/base/content/aboutMessage.xhtml b/mail/base/content/aboutMessage.xhtml index 37254113c0..db149cc947 100644 --- a/mail/base/content/aboutMessage.xhtml +++ b/mail/base/content/aboutMessage.xhtml @@ -62,6 +62,8 @@ + + diff --git a/mail/extensions/openpgp/content/modules/mimeVerify.jsm b/mail/extensions/openpgp/content/modules/mimeVerify.jsm index b00d78c21b..6c95335f2b 100644 --- a/mail/extensions/openpgp/content/modules/mimeVerify.jsm +++ b/mail/extensions/openpgp/content/modules/mimeVerify.jsm @@ -10,9 +10,6 @@ const EXPORTED_SYMBOLS = ["EnigmailVerify"]; * Module for handling PGP/MIME signed messages implemented as JS module. */ -const { MailServices } = ChromeUtils.import( - "resource:///modules/MailServices.jsm" -); const { XPCOMUtils } = ChromeUtils.importESModule( "resource://gre/modules/XPCOMUtils.sys.mjs" ); @@ -55,7 +52,7 @@ function MimeVerify(protocol) { var EnigmailVerify = { _initialized: false, - lastMsgWindow: null, + lastWindow: null, lastMsgUri: null, manualMsgUri: null, @@ -76,10 +73,10 @@ var EnigmailVerify = { } }, - setMsgWindow(msgWindow, msgUriSpec) { - LOCAL_DEBUG("mimeVerify.jsm: setMsgWindow: " + msgUriSpec + "\n"); + setWindow(window, msgUriSpec) { + LOCAL_DEBUG("mimeVerify.jsm: setWindow: " + msgUriSpec + "\n"); - this.lastMsgWindow = msgWindow; + this.lastWindow = window; this.lastMsgUri = msgUriSpec; }, @@ -154,10 +151,9 @@ MimeVerify.prototype = { dataCount: 0, foundMsg: false, startMsgStr: "", - msgWindow: null, + window: null, msgUriSpec: null, statusDisplayed: false, - window: null, inStream: null, sigFile: null, sigData: "", @@ -165,36 +161,6 @@ MimeVerify.prototype = { QueryInterface: ChromeUtils.generateQI(["nsIStreamListener"]), - startStreaming(window, msgWindow, msgUriSpec) { - LOCAL_DEBUG("mimeVerify.jsm: startStreaming\n"); - - this.msgWindow = msgWindow; - this.msgUriSpec = msgUriSpec; - this.window = window; - let msgSvc = MailServices.messageServiceFromURI(this.msgUriSpec); - - msgSvc.streamMessage( - this.msgUriSpec, - this, - this.msgWindow, - null, - false, - null, - false - ); - }, - - verifyData(window, msgWindow, msgUriSpec, data) { - LOCAL_DEBUG("mimeVerify.jsm: streamFromChannel\n"); - - this.msgWindow = msgWindow; - this.msgUriSpec = msgUriSpec; - this.window = window; - this.onStartRequest(); - this.onTextData(data); - this.onStopRequest(); - }, - parseContentType() { let contentTypeLine = this.mimeSvc.contentType; @@ -495,7 +461,7 @@ MimeVerify.prototype = { onStopRequest() { lazy.EnigmailLog.DEBUG("mimeVerify.jsm: onStopRequest\n"); - this.msgWindow = EnigmailVerify.lastMsgWindow; + this.window = EnigmailVerify.lastWindow; this.msgUriSpec = EnigmailVerify.lastMsgUri; this.backgroundJob = false; @@ -610,8 +576,7 @@ MimeVerify.prototype = { } if (this.protocol === PGPMIME_PROTO) { - var windowManager = Services.wm; - var win = windowManager.getMostRecentWindow(null); + let win = this.window; if (!lazy.EnigmailDecryption.isReady(win)) { return; @@ -678,13 +643,11 @@ MimeVerify.prototype = { this.mimeSvc.outputDecryptedData(data, data.length); }, - setMsgWindow(msgWindow, msgUriSpec) { - lazy.EnigmailLog.DEBUG( - "mimeVerify.jsm: setMsgWindow: " + msgUriSpec + "\n" - ); + setWindow(window, msgUriSpec) { + lazy.EnigmailLog.DEBUG("mimeVerify.jsm: setWindow: " + msgUriSpec + "\n"); - if (!this.msgWindow) { - this.msgWindow = msgWindow; + if (!this.window) { + this.window = window; this.msgUriSpec = msgUriSpec; } }, @@ -693,7 +656,7 @@ MimeVerify.prototype = { lazy.EnigmailLog.DEBUG("mimeVerify.jsm: displayStatus\n"); if ( this.exitCode === null || - this.msgWindow === null || + this.window === null || this.statusDisplayed || this.backgroundJob ) { diff --git a/mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js b/mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js index 4ccc2572de..290f49853a 100644 --- a/mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js +++ b/mail/extensions/openpgp/content/ui/enigmailMsgHdrViewOverlay.js @@ -567,10 +567,7 @@ Enigmail.hdrView = { try { Enigmail.hdrView.statusBarHide(); - EnigmailVerify.setMsgWindow( - msgWindow, - Enigmail.msg.getCurrentMsgUriSpec() - ); + EnigmailVerify.setWindow(window, Enigmail.msg.getCurrentMsgUriSpec()); let msgFrame = document.getElementById("messagepane").contentDocument; @@ -600,6 +597,7 @@ Enigmail.hdrView = { ); try { + EnigmailVerify.setWindow(null, null); Enigmail.hdrView.statusBarHide(); } catch (ex) {} }, diff --git a/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js b/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js index 1e42922303..1775df3a19 100644 --- a/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js +++ b/mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js @@ -4,8 +4,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* import-globals-from ../../../../mailnews/extensions/smime/msgReadSMIMEOverlay.js */ -/* import-globals-from ../../../base/content/folderDisplay.js */ -/* import-globals-from ../../../base/content/mailWindow.js */ /* import-globals-from ../../../base/content/msgHdrView.js */ var gEncryptedURIService = null; @@ -291,21 +289,22 @@ var smimeHeaderSink = { .GetStringFromName("CantDecryptBody") .replace(/%brand%/g, brand); - // insert our message - msgWindow.displayHTMLInMessagePane( - title, - "\n" + - '
\n' + - "\n" +
- ' \n" + - body + - "\n" + - " |