From 665d1181b670186e580e42a1cdf27c591d6ae600 Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Tue, 5 Mar 2002 01:23:31 +0000 Subject: [PATCH] Fix for bug 128887. Need to allocate an extra spot in the attachment list for the inline message itself. R=varada, SR=sspitzer, A=asa --- mailnews/mime/src/mimemoz2.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mailnews/mime/src/mimemoz2.cpp b/mailnews/mime/src/mimemoz2.cpp index 499e8cbd279a..d38965b207f3 100644 --- a/mailnews/mime/src/mimemoz2.cpp +++ b/mailnews/mime/src/mimemoz2.cpp @@ -510,6 +510,7 @@ MimeGetAttachmentList(MimeObject *tobj, const char *aMessageURL, nsMsgAttachment MimeContainer *cobj; PRInt32 n; PRBool isAlternativeOrRelated = PR_FALSE; + PRBool isAnInlineMessage; if (!data) return 0; @@ -528,8 +529,14 @@ MimeGetAttachmentList(MimeObject *tobj, const char *aMessageURL, nsMsgAttachment if (isAlternativeOrRelated) return 0; + isAnInlineMessage = mime_typep(obj, (MimeObjectClass *) &mimeMessageClass); + cobj = (MimeContainer*) obj; n = CountTotalMimeAttachments(cobj); + //in case of an inline message (as body), we need an extra slot for the message itself + //that we will fill later... + if (isAnInlineMessage) + n ++; if (n <= 0) return n; @@ -544,7 +551,7 @@ MimeGetAttachmentList(MimeObject *tobj, const char *aMessageURL, nsMsgAttachment nsresult rv; - if (mime_typep(obj, (MimeObjectClass *) &mimeMessageClass)) + if (isAnInlineMessage) { rv = GenerateAttachmentData(obj, aMessageURL, obj->options, PR_FALSE, *data); NS_ENSURE_SUCCESS(rv, rv);