mailcomposer
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -677,2 +677,11 @@ var Stream = require("stream").Stream, | ||
// If in-reply-to message id is missing from the references, add it automatically | ||
if(this._message.inReplyTo && this._message.inReplyTo.length && | ||
(this._message.references || "").toString().indexOf(this._message.inReplyTo) < 0){ | ||
this._message.references = []. | ||
concat(this._message.inReplyTo). | ||
concat(this._message.references || []). | ||
join(" "); | ||
} | ||
// REFERENCES | ||
@@ -679,0 +688,0 @@ if(this._message.references && this._message.references.length){ |
{ | ||
"name": "mailcomposer", | ||
"description": "Compose E-Mail messages", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author" : "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "maintainers":[ |
@@ -198,2 +198,66 @@ var testCase = require('nodeunit').testCase, | ||
test.done(); | ||
}, | ||
"Auto references from in-reply-to 1": function(test){ | ||
var mc = new MailComposer(); | ||
mc.setMessageOption({ | ||
inReplyTo: "test" | ||
}); | ||
mc._buildMessageHeaders(); | ||
test.equal(mc._getHeader("in-reply-to"), "<test>"); | ||
test.equal(mc._getHeader("references"), "<test>"); | ||
test.done(); | ||
}, | ||
"Auto references from in-reply-to 2": function(test){ | ||
var mc = new MailComposer(); | ||
mc.setMessageOption({ | ||
inReplyTo: "test", | ||
references: "test" | ||
}); | ||
mc._buildMessageHeaders(); | ||
test.equal(mc._getHeader("in-reply-to"), "<test>"); | ||
test.equal(mc._getHeader("references"), "<test>"); | ||
test.done(); | ||
}, | ||
"Auto references from in-reply-to 3": function(test){ | ||
var mc = new MailComposer(); | ||
mc.setMessageOption({ | ||
inReplyTo: "test", | ||
references: ["test"] | ||
}); | ||
mc._buildMessageHeaders(); | ||
test.equal(mc._getHeader("in-reply-to"), "<test>"); | ||
test.equal(mc._getHeader("references"), "<test>"); | ||
test.done(); | ||
}, | ||
"Auto references from in-reply-to 4": function(test){ | ||
var mc = new MailComposer(); | ||
mc.setMessageOption({ | ||
inReplyTo: "test", | ||
references: ["<test2>"] | ||
}); | ||
mc._buildMessageHeaders(); | ||
test.equal(mc._getHeader("in-reply-to"), "<test>"); | ||
test.equal(mc._getHeader("references"), "<test> <test2>"); | ||
test.done(); | ||
}, | ||
"Auto references from in-reply-to 5": function(test){ | ||
var mc = new MailComposer(); | ||
mc.setMessageOption({ | ||
inReplyTo: "test", | ||
references: ["test2 test"] | ||
}); | ||
mc._buildMessageHeaders(); | ||
test.equal(mc._getHeader("in-reply-to"), "<test>"); | ||
test.equal(mc._getHeader("references"), "<test2> <test>"); | ||
test.done(); | ||
} | ||
@@ -200,0 +264,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
189624
2923