Bug #305999 --> make addbook urls work again for adding vcards to the address book by making

the content type valid.

r=bz
sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2005-08-26 08:00:55 +00:00
Родитель 1cd7b4b8f2
Коммит 536e43c5a2
4 изменённых файлов: 5 добавлений и 5 удалений

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

@ -209,7 +209,7 @@ static const nsModuleComponentInfo components[] =
{ "add vCard content handler",
NS_ADDRESSBOOK_CID,
NS_CONTENT_HANDLER_CONTRACTID_PREFIX"x-application-addvcard",
NS_CONTENT_HANDLER_CONTRACTID_PREFIX"application/x-addvcard",
nsAddressBookConstructor },
{ "add vCard content handler",

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

@ -173,7 +173,7 @@ nsAddbookProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel **_retval)
pipeOut->Close();
return NS_NewInputStreamChannel(_retval, aURI, pipeIn,
NS_LITERAL_CSTRING("x-application-addvcard"));
NS_LITERAL_CSTRING("application/x-addvcard"));
}
nsString output;

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

@ -1190,7 +1190,7 @@ NS_IMETHODIMP nsAddressBook::HandleContent(const char * aContentType,
nsresult rv = NS_OK;
// 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-application-addvcard") == 0) {
if (nsCRT::strcasecmp(aContentType, "application/x-addvcard") == 0) {
nsCOMPtr<nsIURI> uri;
nsCOMPtr<nsIChannel> aChannel = do_QueryInterface(request);
if (!aChannel) return NS_ERROR_FAILURE;
@ -1262,7 +1262,7 @@ NS_IMETHODIMP nsAddressBook::HandleContent(const char * aContentType,
NS_ENSURE_SUCCESS(rv, rv);
}
else // The content-type was not x-application-addvcard...
else // The content-type was not application/x-addvcard...
return NS_ERROR_WONT_HANDLE_CONTENT;
return rv;

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

@ -879,7 +879,7 @@ static const nsModuleComponentInfo gComponents[] = {
NS_ADDBOOKURL_CONTRACTID, nsAddbookUrlConstructor },
{ "The addbook Protocol Handler", NS_ADDBOOK_HANDLER_CID,
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "addbook", nsAddbookProtocolHandlerConstructor },
{ "add vCard content handler", NS_ADDRESSBOOK_CID, NS_CONTENT_HANDLER_CONTRACTID_PREFIX"x-application-addvcard", nsAddressBookConstructor },
{ "add vCard content handler", NS_ADDRESSBOOK_CID, NS_CONTENT_HANDLER_CONTRACTID_PREFIX"application/x-addvcard", nsAddressBookConstructor },
{ "add vCard content handler", NS_ADDRESSBOOK_CID, NS_CONTENT_HANDLER_CONTRACTID_PREFIX"text/x-vcard", nsAddressBookConstructor },
{ "The directory factory service interface", NS_ABDIRFACTORYSERVICE_CID,