fix 274156 clear has attachment flag if user clicks on a message w/o attachments that we thought did have attachment because of mime content type of multipart/mixed, sr=mscott

This commit is contained in:
bienvenu%nventure.com 2004-12-22 21:39:49 +00:00
Родитель 81e617c0f3
Коммит 8b60a2f0bd
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -393,13 +393,14 @@ var messageHeaderSink = {
// presentation level change....don't show vcards as external attachments in the UI.
// libmime already renders them inline.
if (!mSaveHdr)
mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri);
if (contentType == "text/x-vcard")
{
var inlineAttachments = pref.getBoolPref("mail.inline_attachments");
var displayHtmlAs = pref.getIntPref("mailnews.display.html_as");
if (inlineAttachments && !displayHtmlAs)
{
mSaveHdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri);
return;
}
}
@ -418,8 +419,7 @@ var messageHeaderSink = {
try {
// convert the uri into a hdr
var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri);
hdr.markHasAttachments(true);
mSaveHdr.markHasAttachments(true);
}
catch (ex) {
dump("ex = " + ex + "\n");
@ -429,15 +429,19 @@ var messageHeaderSink = {
onEndAllAttachments: function()
{
// if we only got a v-card, turn off the attachments flag
if (!currentAttachments.length && mSaveHdr)
mSaveHdr.markHasAttachments(false);
mSaveHdr = null;
displayAttachmentsForExpandedView();
},
onEndMsgDownload: function(url)
{
// if we don't have any attachments, turn off the attachments flag
if (!mSaveHdr)
{
var messageUrl = url.QueryInterface(Components.interfaces.nsIMsgMessageUrl);
mSaveHdr = messenger.messageServiceFromURI(messageUrl.uri).messageURIToMsgHdr(messageUrl.uri);
}
if (!currentAttachments.length && mSaveHdr)
mSaveHdr.markHasAttachments(false);
OnMsgParsed(url);
},