зеркало из https://github.com/mozilla/pjs.git
Bug #10802 --> in order to implement open attachment i need the mail news channels to implement set owner
and set/get contenttype r=sspitzer
This commit is contained in:
Родитель
e150ad9e29
Коммит
3819f3da95
|
@ -419,14 +419,17 @@ NS_IMETHODIMP nsMsgProtocol::GetContentType(char * *aContentType)
|
|||
// us to optimize the case where the message url actual refers to
|
||||
// a part in the message that has a content type that is not message/rfc822
|
||||
|
||||
*aContentType = nsCRT::strdup("message/rfc822");
|
||||
if (m_ContentType.IsEmpty())
|
||||
*aContentType = nsCRT::strdup("message/rfc822");
|
||||
else
|
||||
*aContentType = m_ContentType.ToNewCString();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgProtocol::SetContentType(const char *aContentType)
|
||||
{
|
||||
// XXX: Do not allow the content type to be changed (yet)
|
||||
return NS_ERROR_FAILURE;
|
||||
m_ContentType = aContentType;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgProtocol::GetContentLength(PRInt32 * aContentLength)
|
||||
|
@ -521,14 +524,15 @@ nsMsgProtocol::SetPipeliningAllowed(PRBool aPipeliningAllowed)
|
|||
|
||||
NS_IMETHODIMP nsMsgProtocol::GetOwner(nsISupports * *aPrincipal)
|
||||
{
|
||||
*aPrincipal = nsnull;
|
||||
*aPrincipal = mOwner;
|
||||
NS_IF_ADDREF(*aPrincipal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgProtocol::SetOwner(nsISupports * aPrincipal)
|
||||
{
|
||||
NS_NOTREACHED("SetOwner");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
mOwner = aPrincipal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgProtocol::GetLoadGroup(nsILoadGroup * *aLoadGroup)
|
||||
|
|
|
@ -117,6 +117,8 @@ protected:
|
|||
nsLoadFlags mLoadAttributes;
|
||||
nsCOMPtr<nsIProgressEventSink> mProgressEventSink;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
nsCString m_ContentType;
|
||||
};
|
||||
|
||||
#endif /* nsMsgProtocol_h__ */
|
||||
|
|
|
@ -6770,14 +6770,17 @@ NS_IMETHODIMP nsImapMockChannel::SetLoadAttributes(nsLoadFlags aLoadAttributes)
|
|||
|
||||
NS_IMETHODIMP nsImapMockChannel::GetContentType(char * *aContentType)
|
||||
{
|
||||
*aContentType = nsCRT::strdup("message/rfc822");
|
||||
if (m_ContentType.IsEmpty())
|
||||
*aContentType = nsCRT::strdup("message/rfc822");
|
||||
else
|
||||
*aContentType = m_ContentType.ToNewCString();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMockChannel::SetContentType(const char *aContentType)
|
||||
{
|
||||
// Do not allow the content-type to change.
|
||||
return NS_ERROR_FAILURE;
|
||||
m_ContentType = aContentType;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMockChannel::GetContentLength(PRInt32 * aContentLength)
|
||||
|
@ -6872,14 +6875,15 @@ nsImapMockChannel::SetPipeliningAllowed(PRBool aPipeliningAllowed)
|
|||
|
||||
NS_IMETHODIMP nsImapMockChannel::GetOwner(nsISupports * *aPrincipal)
|
||||
{
|
||||
*aPrincipal = nsnull;
|
||||
*aPrincipal = mOwner;
|
||||
NS_IF_ADDREF(*aPrincipal);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMockChannel::SetOwner(nsISupports * aPrincipal)
|
||||
{
|
||||
NS_NOTREACHED("nsImapMockChannel::SetOwner");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
mOwner = aPrincipal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -602,6 +602,8 @@ protected:
|
|||
nsLoadFlags mLoadAttributes;
|
||||
nsCOMPtr<nsIProgressEventSink> mProgressEventSink;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
||||
nsCOMPtr<nsISupports> mOwner;
|
||||
nsCString m_ContentType;
|
||||
};
|
||||
|
||||
#endif // nsImapProtocol_h___
|
||||
|
|
Загрузка…
Ссылка в новой задаче