From 2e710c68248885a85ffe0730970dc6002ecc61ba Mon Sep 17 00:00:00 2001 From: "kaie%netscape.com" Date: Fri, 20 Jun 2003 01:12:15 +0000 Subject: [PATCH] b=209995 Incorrect S/Mime status shown in UI r/sr=sspitzer git-svn-id: svn://10.0.0.236/trunk@143967 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/mime/src/mimecms.cpp | 39 ++++++++++++++++++++------ mozilla/mailnews/mime/src/mimemcms.cpp | 39 ++++++++++++++++++++------ 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/mozilla/mailnews/mime/src/mimecms.cpp b/mozilla/mailnews/mime/src/mimecms.cpp index 137903770e5..3b047aa3352 100644 --- a/mozilla/mailnews/mime/src/mimecms.cpp +++ b/mozilla/mailnews/mime/src/mimecms.cpp @@ -468,15 +468,36 @@ MimeCMS_init(MimeObject *obj, nsCOMPtr securityInfo; channel->GetURI(getter_AddRefs(uri)); if (uri) - msgurl = do_QueryInterface(uri); - if (msgurl) - msgurl->GetMsgWindow(getter_AddRefs(msgWindow)); - if (msgWindow) - msgWindow->GetMsgHeaderSink(getter_AddRefs(headerSink)); - if (headerSink) - headerSink->GetSecurityInfo(getter_AddRefs(securityInfo)); - if (securityInfo) - data->smimeHeaderSink = do_QueryInterface(securityInfo); + { + nsCAutoString urlSpec; + rv = uri->GetSpec(urlSpec); + + // We only want to update the UI if the current mime transaction + // is intended for display. + // If the current transaction is intended for background processing, + // we can learn that by looking at the additional header=filter + // string contained in the URI. + // + // If we find something, we do not set smimeHeaderSink, + // which will prevent us from giving UI feedback. + // + // If we do not find header=filter, we assume the result of the + // processing will be shown in the UI. + + if (!strstr(urlSpec.get(), "?header=filter") && + !strstr(urlSpec.get(), "&header=filter")) + { + msgurl = do_QueryInterface(uri); + if (msgurl) + msgurl->GetMsgWindow(getter_AddRefs(msgWindow)); + if (msgWindow) + msgWindow->GetMsgHeaderSink(getter_AddRefs(headerSink)); + if (headerSink) + headerSink->GetSecurityInfo(getter_AddRefs(securityInfo)); + if (securityInfo) + data->smimeHeaderSink = do_QueryInterface(securityInfo); + } + } } // if channel } // if msd diff --git a/mozilla/mailnews/mime/src/mimemcms.cpp b/mozilla/mailnews/mime/src/mimemcms.cpp index b933315ff58..f9f19182c5f 100644 --- a/mozilla/mailnews/mime/src/mimemcms.cpp +++ b/mozilla/mailnews/mime/src/mimemcms.cpp @@ -272,15 +272,36 @@ MimeMultCMS_init (MimeObject *obj) nsCOMPtr securityInfo; channel->GetURI(getter_AddRefs(uri)); if (uri) - msgurl = do_QueryInterface(uri); - if (msgurl) - msgurl->GetMsgWindow(getter_AddRefs(msgWindow)); - if (msgWindow) - msgWindow->GetMsgHeaderSink(getter_AddRefs(headerSink)); - if (headerSink) - headerSink->GetSecurityInfo(getter_AddRefs(securityInfo)); - if (securityInfo) - data->smimeHeaderSink = do_QueryInterface(securityInfo); + { + nsCAutoString urlSpec; + rv = uri->GetSpec(urlSpec); + + // We only want to update the UI if the current mime transaction + // is intended for display. + // If the current transaction is intended for background processing, + // we can learn that by looking at the additional header=filter + // string contained in the URI. + // + // If we find something, we do not set smimeHeaderSink, + // which will prevent us from giving UI feedback. + // + // If we do not find header=filter, we assume the result of the + // processing will be shown in the UI. + + if (!strstr(urlSpec.get(), "?header=filter") && + !strstr(urlSpec.get(), "&header=filter")) + { + msgurl = do_QueryInterface(uri); + if (msgurl) + msgurl->GetMsgWindow(getter_AddRefs(msgWindow)); + if (msgWindow) + msgWindow->GetMsgHeaderSink(getter_AddRefs(headerSink)); + if (headerSink) + headerSink->GetSecurityInfo(getter_AddRefs(securityInfo)); + if (securityInfo) + data->smimeHeaderSink = do_QueryInterface(securityInfo); + } + } } // if channel } // if msd