зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
1cd7b4b8f2
Коммит
536e43c5a2
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче