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

This commit is contained in:
ducarroz%netscape.com 2002-03-05 01:23:31 +00:00
Родитель 1e02d647f3
Коммит 665d1181b6
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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);