Skip to content

Instantly share code, notes, and snippets.

@shirosaki
Created January 30, 2014 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shirosaki/8700643 to your computer and use it in GitHub Desktop.
Save shirosaki/8700643 to your computer and use it in GitHub Desktop.
Fix the bug that attachments of PGP/MIME are not showen
diff --git a/package/mimeDecrypt.js b/package/mimeDecrypt.js
index 6b09272..84e384e 100644
--- a/package/mimeDecrypt.js
+++ b/package/mimeDecrypt.js
@@ -165,10 +165,15 @@ PgpMimeDecrypt.prototype = {
if (this.uri.spec.search(/[\&\?]header=[a-zA-Z0-9]*$/) < 0 &&
this.uri.spec.search(/[\&\?]part=[\.0-9]+/) < 0) {
- if (this.uri.spec.search(/[\&\?]header=filter\&.*$/) > 0)
+ // do not return so that jsmimeemitter can handle decrypted message
+ var emitterJs = false;
+ if (this.uri.spec.search(/[\&\?]header=filter\&emitter=js.*$/) >= 0)
+ emitterJs = true;
+
+ if (this.uri.spec.search(/[\&\?]header=filter\&.*$/) > 0 && !emitterJs)
return;
- if (this.msgUriSpec) {
+ if (this.msgUriSpec && !emitterJs) {
var messenger = Cc["@mozilla.org/messenger;1"].getService(Ci.nsIMessenger);
var msgSvc = messenger.messageServiceFromURI(this.msgUriSpec);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment