mailparser
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -287,3 +287,3 @@ "use strict"; | ||
textContent = ["text/plain", "text/html"].indexOf(this._currentNode.meta.contentType || "") >= 0; | ||
textContent = ["text/plain", "text/html", "text/calendar"].indexOf(this._currentNode.meta.contentType || "") >= 0; | ||
@@ -400,3 +400,3 @@ // detect if this is an attachment or a text node (some agents use inline dispositions for text) | ||
// handle text or attachment line | ||
if(["text/plain", "text/html"].indexOf(this._currentNode.meta.contentType || "")>=0 && | ||
if(["text/plain", "text/html", "text/calendar"].indexOf(this._currentNode.meta.contentType || "")>=0 && | ||
!this._currentNode.attachment){ | ||
@@ -641,2 +641,7 @@ this._handleTextLine(line); | ||
if(value.method){ | ||
this._currentNode.meta.method = value.method; | ||
} | ||
if(!this._currentNode.meta.fileName && (fileName = this._detectFilename(value))){ | ||
@@ -917,3 +922,3 @@ this._currentNode.meta.fileName = fileName; | ||
this.mailData = {html:[], text:[], attachments:[]}; | ||
this.mailData = {html:[], text:[], calendar:[], attachments:[]}; | ||
@@ -946,2 +951,10 @@ if(!this.mimeTree.meta.mimeMultipart){ | ||
if(this.mailData.calendar.length){ | ||
returnValue.alternatives = []; | ||
for(i=0, len=this.mailData.calendar.length; i<len; i++){ | ||
returnValue.alternatives.push(this.mailData.calendar[i].content); | ||
} | ||
} | ||
returnValue.headers = this.mimeTree.parsedHeaders; | ||
@@ -1051,2 +1064,8 @@ | ||
return; | ||
case "text/calendar": | ||
if(node.content){ | ||
node.meta.content = node.content; | ||
} | ||
this.mailData.calendar.push({content: node.meta || {}, level: level}); | ||
return; | ||
} | ||
@@ -1053,0 +1072,0 @@ }else{ |
{ | ||
"name": "mailparser", | ||
"description": "Asynchronous and non-blocking parser for mime encoded e-mail messages", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"author" : "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "maintainers":[ |
130271
2810