Use a valid MIME type for the "display" stuff in mailnews. r=bienvenu,

sr=mscott.
This commit is contained in:
bzbarsky%mit.edu 2005-08-16 00:06:16 +00:00
Родитель a31fb44d08
Коммит 7cd523c3c6
11 изменённых файлов: 25 добавлений и 25 удалений

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

@ -1242,7 +1242,7 @@ function MsgOpenFromFile()
}
var uri = fp.fileURL;
uri.query = "type=x-message-display";
uri.query = "type=application/x-message-display";
MsgOpenNewWindowForMessage(uri, null);
}
@ -2099,7 +2099,7 @@ function HandleJunkStatusChanged(folder)
// this might be the stand alone window, open to a message that was
// and attachment (or on disk), in which case, we want to ignore it.
var loadedMessage = GetLoadedMessage();
if (loadedMessage && (!(/type=x-message-display/.test(loadedMessage))) && IsCurrentLoadedFolder(folder))
if (loadedMessage && (!(/type=application\/x-message-display/.test(loadedMessage))) && IsCurrentLoadedFolder(folder))
{
// if multiple message are selected
// and we change the junk status
@ -2180,7 +2180,7 @@ var gMessageNotificationBar =
setPhishingMsg: function(aUrl)
{
var msgURI = GetLoadedMessage();
if (msgURI && !(/type=x-message-display/.test(msgURI)))
if (msgURI && !(/type=application\/x-message-display/.test(msgURI)))
{
var msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
// if we've explicitly marked this message as not being an email scam, then don't
@ -2221,7 +2221,7 @@ function LoadMsgWithRemoteContent()
var msgURI = GetLoadedMessage();
var msgHdr = null;
if (msgURI && !(/type=x-message-display/.test(msgURI)))
if (msgURI && !(/type=application\/x-message-display/.test(msgURI)))
{
msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
if (msgHdr)
@ -2241,7 +2241,7 @@ function MsgIsNotAScam()
var msgURI = GetLoadedMessage();
var msgHdr = null;
if (msgURI && !(/type=x-message-display/.test(msgURI)))
if (msgURI && !(/type=application\/x-message-display/.test(msgURI)))
{
msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
if (msgHdr)
@ -2295,7 +2295,7 @@ function OnMsgLoaded(aUrl)
// SetNextMessageAfterDelete() when the operation completes (bug 243532).
gNextMessageViewIndexAfterDelete = -2;
if (!(/type=x-message-display/.test(msgURI)))
if (!(/type=application\/x-message-display/.test(msgURI)))
msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
gMessageNotificationBar.setJunkMsg(msgHdr);

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

@ -287,7 +287,7 @@ function delayedOnLoadMessageWindow()
messageUri = window.arguments[0];
if (messageUri instanceof Components.interfaces.nsIURI)
{
loadCustomMessage = /type=x-message-display/.test(messageUri.spec);
loadCustomMessage = /type=application\/x-message-display/.test(messageUri.spec);
gCurrentMessageUri = messageUri.spec;
if (messageUri instanceof Components.interfaces.nsIMsgMailNewsUrl)
folder = messageUri.folder;

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

@ -372,7 +372,7 @@ static const nsModuleComponentInfo gComponents[] = {
nsMessengerOS2IntegrationConstructor,
},
#endif
{ "x-message-display content handler",
{ "application/x-message-display content handler",
NS_MESSENGERCONTENTHANDLER_CID,
NS_MESSENGERCONTENTHANDLER_CONTRACTID,
nsMessengerContentHandlerConstructor

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

@ -1149,7 +1149,7 @@ function MsgOpenFromFile()
}
var uri = fp.fileURL;
uri.query = "type=x-message-display";
uri.query = "type=application/x-message-display";
MsgOpenNewWindowForMessage(uri, null);
}
@ -2063,7 +2063,7 @@ function HandleJunkStatusChanged(folder)
// this might be the stand alone window, open to a message that was
// and attachment (or on disk), in which case, we want to ignore it.
var loadedMessage = GetLoadedMessage();
if (loadedMessage && (!(/type=x-message-display/.test(loadedMessage))) && IsCurrentLoadedFolder(folder))
if (loadedMessage && (!(/type=application\/x-message-display/.test(loadedMessage))) && IsCurrentLoadedFolder(folder))
{
// if multiple message are selected and we change the junk status
// we don't want to show the junk bar (since the message pane is blank)
@ -2168,7 +2168,7 @@ function setMsgHdrPropertyAndReload(aProperty, aValue)
var msgURI = GetLoadedMessage();
if (msgURI && !(/type=x-message-display/.test(msgURI)))
if (msgURI && !(/type=application\/x-message-display/.test(msgURI)))
{
var msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
if (msgHdr)
@ -2186,7 +2186,7 @@ function checkMsgHdrPropertyIsNot(aProperty, aValue)
var msgURI = GetLoadedMessage();
if (msgURI && !(/type=x-message-display/.test(msgURI)))
if (msgURI && !(/type=application\/x-message-display/.test(msgURI)))
{
var msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
return (msgHdr && msgHdr.getUint32Property(aProperty) != aValue);
@ -2231,7 +2231,7 @@ function OnMsgLoaded(aUrl)
// SetNextMessageAfterDelete() when the operation completes (bug 243532).
gNextMessageViewIndexAfterDelete = -2;
if (!(/type=x-message-display/.test(msgURI)))
if (!(/type=application\/x-message-display/.test(msgURI)))
msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);
gMessageNotificationBar.setJunkMsg(msgHdr);

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

@ -279,7 +279,7 @@ function OnLoadMessageWindow()
messageUri = window.arguments[0];
if (messageUri instanceof Components.interfaces.nsIURI)
{
loadCustomMessage = /type=x-message-display/.test(messageUri.spec);
loadCustomMessage = /type=application\/x-message-display/.test(messageUri.spec);
gCurrentMessageUri = messageUri.spec;
if (messageUri instanceof Components.interfaces.nsIMsgMailNewsUrl)
folder = messageUri.folder;

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

@ -730,12 +730,12 @@ nsMessenger::SaveAttachment(nsIFileSpec * fileSpec,
}
urlString = url;
// strip out ?type=x-message-display because it confuses libmime
// strip out ?type=application/x-message-display because it confuses libmime
PRInt32 typeIndex = urlString.Find("?type=x-message-display");
PRInt32 typeIndex = urlString.Find("?type=application/x-message-display");
if (typeIndex != kNotFound)
{
urlString.Cut(typeIndex, sizeof("?type=x-message-display") - 1);
urlString.Cut(typeIndex, sizeof("?type=application/x-message-display") - 1);
// we also need to replace the next '&' with '?'
PRInt32 firstPartIndex = urlString.FindChar('&');
if (firstPartIndex != kNotFound)

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

@ -142,7 +142,7 @@ nsMessengerBootstrap::Handle(nsICommandLine* aCmdLine)
nsCOMPtr<nsISupportsString> scriptableURL (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableURL, NS_ERROR_FAILURE);
fileURL->SetQuery(NS_LITERAL_CSTRING("?type=x-message-display"));
fileURL->SetQuery(NS_LITERAL_CSTRING("?type=application/x-message-display"));
wwatch->OpenWindow(nsnull, "chrome://messenger/content/messageWindow.xul", "_blank",
"chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar,dialog=no", fileURL, getter_AddRefs(opened));

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

@ -67,7 +67,7 @@ NS_IMETHODIMP nsMessengerContentHandler::HandleContent(const char * aContentType
return NS_ERROR_NULL_POINTER;
// First of all, get the content type and make sure it is a content type we know how to handle!
if (nsCRT::strcasecmp(aContentType, "x-message-display") == 0) {
if (nsCRT::strcasecmp(aContentType, "application/x-message-display") == 0) {
nsCOMPtr<nsIURI> aUri;
nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
if (!aChannel) return NS_ERROR_FAILURE;
@ -83,7 +83,7 @@ NS_IMETHODIMP nsMessengerContentHandler::HandleContent(const char * aContentType
{
nsCAutoString queryPart;
aUrl->GetQuery(queryPart);
queryPart.ReplaceSubstring("type=message/rfc822", "type=x-message-display");
queryPart.ReplaceSubstring("type=message/rfc822", "type=application/x-message-display");
aUrl->SetQuery(queryPart);
rv = OpenWindow(aUri);
}

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

@ -508,6 +508,6 @@
{0xb9, 0x6b, 0xf5, 0x9e, 0x39, 0x24, 0x73, 0xb0}}
#define NS_MESSENGERCONTENTHANDLER_CONTRACTID \
NS_CONTENT_HANDLER_CONTRACTID_PREFIX "x-message-display"
NS_CONTENT_HANDLER_CONTRACTID_PREFIX "application/x-message-display"
#endif // nsMessageBaseCID_h__

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

@ -832,7 +832,7 @@ static const nsModuleComponentInfo gComponents[] = {
nsMessengerOSXIntegrationConstructor,
},
#endif
{ "x-message-display content handler",
{ "application/x-message-display content handler",
NS_MESSENGERCONTENTHANDLER_CID,
NS_MESSENGERCONTENTHANDLER_CONTRACTID,
nsMessengerContentHandlerConstructor

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

@ -418,7 +418,7 @@ nsStreamConverter::DetermineOutputFormat(const char *aUrl, nsMimeOutputType *aNe
// content type appended to it...if it does, we want to remember
// that as mOutputFormat
const char * typeField = FindQueryElementData(queryPart, "type=");
if (typeField && !strncmp(typeField, "x-message-display", sizeof("x-message-display") - 1))
if (typeField && !strncmp(typeField, "application/x-message-display", sizeof("application/x-message-display") - 1))
{
const char *secondTypeField = FindQueryElementData(typeField, "type=");
if (secondTypeField)
@ -433,11 +433,11 @@ nsStreamConverter::DetermineOutputFormat(const char *aUrl, nsMimeOutputType *aNe
if (mRealContentType.LowerCaseEqualsLiteral("message/rfc822"))
{
mRealContentType = "x-message-display";
mRealContentType = "application/x-message-display";
mOutputFormat = "text/html";
*aNewType = nsMimeOutput::nsMimeMessageBodyDisplay;
}
else if (mRealContentType.LowerCaseEqualsLiteral("x-message-display"))
else if (mRealContentType.LowerCaseEqualsLiteral("application/x-message-display"))
{
mRealContentType = "";
mOutputFormat = "text/html";