|
|
|
@ -42,7 +42,8 @@ MimeEncrypt.prototype = {
|
|
|
|
|
bccRecipients: null,
|
|
|
|
|
replyToRecipients: null,
|
|
|
|
|
originalSubject: null,
|
|
|
|
|
originalReferences: null,
|
|
|
|
|
references: null,
|
|
|
|
|
messageId: null,
|
|
|
|
|
isDraftOrTemplate: false,
|
|
|
|
|
passThrough: false,
|
|
|
|
|
|
|
|
|
@ -54,16 +55,23 @@ MimeEncrypt.prototype = {
|
|
|
|
|
outBuffer: "",
|
|
|
|
|
|
|
|
|
|
// nsIMsgComposeSecure interface
|
|
|
|
|
requiresCryptoEncapsulation() {
|
|
|
|
|
requiresCryptoEncapsulation(msgIdentity, msgCompFields) {
|
|
|
|
|
// Only if our handler was registered in pepmessengercompose.js,
|
|
|
|
|
// we get here and we require encryption.
|
|
|
|
|
// Note that if `msgCompFields.subject` is set here, it will affect the
|
|
|
|
|
// subject in the message that is sent, but that is too early for us.
|
|
|
|
|
// Setting it any later has no effect.
|
|
|
|
|
// So we set the subject even earlier in pepmessengercompose.js.
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
beginCryptoEncapsulation(outStream, recipientList, compFields, msgIdentity, sendReport, isDraft) {
|
|
|
|
|
beginCryptoEncapsulation(outStream, recipientList, msgCompFields, msgIdentity, sendReport, isDraft) {
|
|
|
|
|
// Note that `isDraft` is false when saving as a template, so this is not useful.
|
|
|
|
|
this.outStream = outStream;
|
|
|
|
|
this.outStringStream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
|
|
|
|
|
this.inspector = Cc["@mozilla.org/jsinspector;1"].createInstance(Ci.nsIJSInspector);
|
|
|
|
|
this.references = msgCompFields.references;
|
|
|
|
|
this.messageId = msgCompFields.messageId;
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
@ -110,14 +118,15 @@ MimeEncrypt.prototype = {
|
|
|
|
|
let message = this.controller.synchronise(messagePromise);
|
|
|
|
|
|
|
|
|
|
// Fill in some headers.
|
|
|
|
|
message.id = this.messageId.replace(/^<(.*)>$/, "$1");
|
|
|
|
|
message.shortmsg = this.originalSubject;
|
|
|
|
|
message.from = this.fromSender;
|
|
|
|
|
message.to = this.toRecipients;
|
|
|
|
|
message.cc = this.ccRecipients;
|
|
|
|
|
message.bcc = this.bccRecipients;
|
|
|
|
|
message.reply_to = this.replyToRecipients;
|
|
|
|
|
if (this.originalReferences) {
|
|
|
|
|
message.references = this.originalReferences.split(" ").map((r) => r.replace(/^<(.*)>$/, "$1"));
|
|
|
|
|
if (this.references) {
|
|
|
|
|
message.references = this.references.split(" ").map((r) => r.replace(/^<(.*)>$/, "$1"));
|
|
|
|
|
message.in_reply_to = [message.references[message.references.length - 1]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|