зеркало из https://github.com/mozilla/gecko-dev.git
fix 358657 drag drop of attachments from mail messages to desktop fails, sr=mscott, initial work done by kovalchuk77@list.ru
This commit is contained in:
Родитель
fedbc0523b
Коммит
2600ba69c4
|
@ -559,8 +559,7 @@ NS_IMETHODIMP nsMsgProtocol::GetURI(nsIURI* *aURI)
|
|||
|
||||
NS_IMETHODIMP nsMsgProtocol::Open(nsIInputStream **_retval)
|
||||
{
|
||||
NS_NOTREACHED("Open");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return NS_ImplementChannelOpen(this, _retval);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgProtocol::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
|
||||
|
|
|
@ -5440,9 +5440,9 @@ void nsImapProtocol::UploadMessageFromFile (nsIFileSpec* fileSpec,
|
|||
|
||||
if (flags)
|
||||
{
|
||||
SetupMessageFlagsString(flagString, flags,
|
||||
GetServerStateParser().SupportsUserFlags());
|
||||
command.Append(flagString);
|
||||
SetupMessageFlagsString(flagString, flags,
|
||||
GetServerStateParser().SupportsUserFlags());
|
||||
command.Append(flagString);
|
||||
}
|
||||
if (keywords.Length())
|
||||
{
|
||||
|
@ -8206,8 +8206,7 @@ NS_IMETHODIMP nsImapMockChannel::SetURI(nsIURI* aURI)
|
|||
|
||||
NS_IMETHODIMP nsImapMockChannel::Open(nsIInputStream **_retval)
|
||||
{
|
||||
NS_NOTREACHED("nsImapMockChannel::Open");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
return NS_ImplementChannelOpen(this, _retval);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -346,12 +346,6 @@ GenerateAttachmentData(MimeObject *object, const char *aMessageURL, MimeDisplayO
|
|||
return NS_OK;
|
||||
|
||||
nsMsgAttachmentData *tmp = &(aAttachData[attIndex++]);
|
||||
nsresult rv = nsMimeNewURI(&(tmp->url), urlSpec, nsnull);
|
||||
|
||||
PR_FREEIF(urlSpec);
|
||||
|
||||
if ( (NS_FAILED(rv)) || (!tmp->url) )
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
tmp->real_type = object->content_type ? nsCRT::strdup(object->content_type) : nsnull;
|
||||
tmp->real_encoding = object->encoding ? nsCRT::strdup(object->encoding) : nsnull;
|
||||
|
@ -456,6 +450,23 @@ GenerateAttachmentData(MimeObject *object, const char *aMessageURL, MimeDisplayO
|
|||
else
|
||||
tmp->real_name = mime_part_address(object);
|
||||
}
|
||||
nsCString urlString(urlSpec);
|
||||
|
||||
if (tmp->real_name)
|
||||
{
|
||||
urlString.Append("&filename=");
|
||||
urlString.Append(tmp->real_name);
|
||||
if (tmp->real_type && !strcmp(tmp->real_type, "message/rfc822") &&
|
||||
!StringEndsWith(urlString, NS_LITERAL_CSTRING(".eml"), nsCaseInsensitiveCStringComparator()))
|
||||
urlString.Append(".eml");
|
||||
}
|
||||
nsresult rv = nsMimeNewURI(&(tmp->url), urlString.get(), nsnull);
|
||||
|
||||
PR_FREEIF(urlSpec);
|
||||
|
||||
if ( (NS_FAILED(rv)) || (!tmp->url) )
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
ValidateRealName(tmp, object->headers);
|
||||
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче