зеркало из https://github.com/mozilla/gecko-dev.git
Bug #86773 --> string bundle fix up for signed messages. checking in for ducarroz
r=sspitzer sr=mscott
This commit is contained in:
Родитель
6768f01171
Коммит
871b8fe403
|
@ -265,6 +265,7 @@ en-US.jar:
|
|||
locale/en-US/messenger/mime.properties (mime/resources/mime.properties)
|
||||
locale/en-US/messenger/mimeheader.properties (mime/resources/mimeheader.properties)
|
||||
locale/en-US/messenger/vcard.properties (mime/cthandlers/resources/vcard.properties)
|
||||
locale/en-US/messenger/smime.properties (mime/cthandlers/resources/smime.properties)
|
||||
|
||||
US.jar:
|
||||
locale/US/messenger-region/contents.rdf (base/resources/locale/en-US/contents-region.rdf)
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
#
|
||||
# The following are used by the smime content type handler
|
||||
#
|
||||
|
||||
## @name NS_MSG_UNABLE_TO_OPEN_FILE
|
||||
## LOCALIZATION NOTE: the text can contain HTML tags.
|
||||
1000=This is an <B>ENCRYPTED</B> or <B>SIGNED</B> message.<br> This Mail application does not support encrypted or signed mail.
|
||||
|
||||
|
|
@ -28,6 +28,69 @@
|
|||
#include "mimeobj.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
// String bundles...
|
||||
#include "nsIStringBundle.h"
|
||||
|
||||
#define SMIME_PROPERTIES_URL "chrome://messenger/locale/smime.properties"
|
||||
#define SMIME_STR_NOT_SUPPORTED_ID 1000
|
||||
|
||||
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
#ifndef XP_MAC
|
||||
static nsCOMPtr<nsIStringBundle> stringBundle = nsnull;
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// This is the next generation string retrieval call
|
||||
//
|
||||
static char *SMimeGetStringByID(PRInt32 aMsgId)
|
||||
{
|
||||
char *tempString = nsnull;
|
||||
nsresult res = NS_OK;
|
||||
|
||||
#ifdef XP_MAC
|
||||
nsCOMPtr<nsIStringBundle> stringBundle = nsnull;
|
||||
#endif
|
||||
|
||||
if (!stringBundle)
|
||||
{
|
||||
char* propertyURL = NULL;
|
||||
|
||||
propertyURL = SMIME_PROPERTIES_URL;
|
||||
|
||||
nsCOMPtr<nsIStringBundleService> sBundleService =
|
||||
do_GetService(kStringBundleServiceCID, &res);
|
||||
if (NS_SUCCEEDED(res) && (nsnull != sBundleService))
|
||||
{
|
||||
res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(stringBundle));
|
||||
}
|
||||
}
|
||||
|
||||
if (stringBundle)
|
||||
{
|
||||
PRUnichar *ptrv = nsnull;
|
||||
res = stringBundle->GetStringFromID(aMsgId, &ptrv);
|
||||
|
||||
if (NS_FAILED(res))
|
||||
return nsCRT::strdup("???");
|
||||
else
|
||||
{
|
||||
nsAutoString v;
|
||||
v.Append(ptrv);
|
||||
PR_FREEIF(ptrv);
|
||||
tempString = v.ToNewUTF8String();
|
||||
}
|
||||
}
|
||||
|
||||
if (!tempString)
|
||||
return nsCRT::strdup("???");
|
||||
else
|
||||
return tempString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static int MimeInlineTextSMIMEStub_parse_line (char *, PRInt32, MimeObject *);
|
||||
static int MimeInlineTextSMIMEStub_parse_eof (MimeObject *, PRBool);
|
||||
static int MimeInlineTextSMIMEStub_parse_begin (MimeObject *obj);
|
||||
|
@ -75,13 +138,16 @@ MimeInlineTextSMIMEStubClassInitialize(MimeInlineTextSMIMEStubClass *clazz)
|
|||
int
|
||||
GenerateMessage(char** html)
|
||||
{
|
||||
*html = nsCRT::strdup("\
|
||||
<BR><text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#FF0000\" vlink=\"#800080\" alink=\"#0000FF\">\
|
||||
<center><table BORDER=1 ><tr>\
|
||||
<td><CENTER>This is an <B>ENCRYPTED</B> message. Mozilla Mail does not support encrypted mail.</CENTER></td>\
|
||||
</tr>\
|
||||
</table></center><BR>");
|
||||
nsCString temp;
|
||||
temp.Append("<BR><text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#FF0000\" vlink=\"#800080\" alink=\"#0000FF\">");
|
||||
temp.Append("<center><table BORDER=1 ><tr><td><CENTER>");
|
||||
|
||||
char *tString = SMimeGetStringByID(SMIME_STR_NOT_SUPPORTED_ID);
|
||||
temp.Append(tString);
|
||||
PR_FREEIF(tString);
|
||||
|
||||
temp.Append("</CENTER></td></tr></table></center><BR>");
|
||||
*html = temp.ToNewCString();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMimeContentTypeHandler)
|
|||
static nsModuleComponentInfo components[] =
|
||||
{
|
||||
{ "MIME SMIMEStubed Mail Handler", NS_SMIME_CONTENT_TYPE_HANDLER_CID, "@mozilla.org/mimecth;1?type=application/x-pkcs7-mime",
|
||||
nsMimeContentTypeHandlerConstructor, }
|
||||
nsMimeContentTypeHandlerConstructor, },
|
||||
|
||||
{ "MIME SMIMEStubed Mail Handler", NS_SMIME_CONTENT_TYPE_HANDLER_CID, "@mozilla.org/mimecth;1?type=application/pkcs7-mime",
|
||||
nsMimeContentTypeHandlerConstructor, }
|
||||
|
||||
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
Загрузка…
Ссылка в новой задаче