diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index d3fad8505ac..cd09dec3414 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -5016,6 +5016,16 @@ NS_IMETHODIMP nsNNTPProtocol::GetContentType(char * *aContentType) { if (!aContentType) return NS_ERROR_NULL_POINTER; + // if we've been set with a content type, then return it.... + // this happens when we go through libmime now as it sets our new content type + if (!m_ContentType.IsEmpty()) + { + *aContentType = m_ContentType.ToNewCString(); + return NS_OK; + } + + // otherwise do what we did before... + if ((const char *)m_currentGroup && nsCRT::strlen((const char *)m_currentGroup)) { // if it is an article url, it has a @ or %40 in it. if (PL_strchr((const char *)m_currentGroup,'@') || PL_strstr((const char *)m_currentGroup,"%40")) { diff --git a/mailnews/news/src/nsNNTPProtocol.h b/mailnews/news/src/nsNNTPProtocol.h index 48936e19127..e36f8c15920 100644 --- a/mailnews/news/src/nsNNTPProtocol.h +++ b/mailnews/news/src/nsNNTPProtocol.h @@ -185,19 +185,19 @@ private: void ParseHeaderForCancel(char *buf); - static PRBool CheckIfAuthor(nsISupports *aElement, void *data); + static PRBool CheckIfAuthor(nsISupports *aElement, void *data); - nsCOMPtr m_tempArticleStream; + nsCOMPtr m_tempArticleStream; // News Event Sinks - nsCOMPtr m_newsgroupList; - nsCOMPtr m_articleList; + nsCOMPtr m_newsgroupList; + nsCOMPtr m_articleList; nsCOMPtr m_newsHost; nsCOMPtr m_newsgroup; nsCOMPtr m_offlineNewsState; - nsCOMPtr m_newsFolder; - nsCOMPtr m_msgWindow; + nsCOMPtr m_newsFolder; + nsCOMPtr m_msgWindow; nsCOMPtr mDisplayInputStream; nsCOMPtr mDisplayOutputStream; @@ -213,25 +213,25 @@ private: // Generic state information -- What state are we in? What state do we want to go to // after the next response? What was the last response code? etc. StatesEnum m_nextState; - StatesEnum m_nextStateAfterResponse; + StatesEnum m_nextStateAfterResponse; PRInt32 m_typeWanted; /* Article, List, or Group */ - PRInt32 m_responseCode; /* code returned from NNTP server */ + PRInt32 m_responseCode; /* code returned from NNTP server */ PRInt32 m_previousResponseCode; - char *m_responseText; /* text returned from NNTP server */ + char *m_responseText; /* text returned from NNTP server */ nsXPIDLCString m_hostName; - nsXPIDLCString m_userName; + nsXPIDLCString m_userName; - char *m_dataBuf; - PRUint32 m_dataBufSize; + char *m_dataBuf; + PRUint32 m_dataBufSize; /* for group command */ - char *m_path; /* message id */ - nsCString m_currentGroup; /* current group */ + char *m_path; /* message id */ + nsCString m_currentGroup; /* current group */ - PRInt32 m_firstArticle; - PRInt32 m_lastArticle; - PRInt32 m_firstPossibleArticle; - PRInt32 m_lastPossibleArticle; + PRInt32 m_firstArticle; + PRInt32 m_lastArticle; + PRInt32 m_firstPossibleArticle; + PRInt32 m_lastPossibleArticle; PRInt32 m_numArticlesLoaded; /* How many articles we got XOVER lines for. */ PRInt32 m_numArticlesWanted; /* How many articles we wanted to get XOVER lines for. */ @@ -239,11 +239,11 @@ private: // Cancelation specific state. In particular, the headers that should be // used for the cancelation message. // mscott: we can probably replace this stuff with nsString - char *m_cancelFromHdr; - char *m_cancelNewsgroups; - char *m_cancelDistribution; - char *m_cancelID; - PRInt32 m_cancelStatus; + char *m_cancelFromHdr; + char *m_cancelNewsgroups; + char *m_cancelDistribution; + char *m_cancelID; + PRInt32 m_cancelStatus; // variables for ReadNewsRC PRInt32 m_newsRCListIndex; @@ -263,11 +263,11 @@ private: nsCOMPtr m_stringBundle; - nsCOMPtr m_nntpServer; + nsCOMPtr m_nntpServer; nsresult GetNewsStringByName(const char *aName, PRUnichar **aString); - PRInt32 PostMessageInFile(nsIFileSpec * filePath); + PRInt32 PostMessageInFile(nsIFileSpec * filePath); //////////////////////////////////////////////////////////////////////////////////////// // Communication methods --> Reading and writing protocol @@ -399,7 +399,7 @@ private: nsresult InitializeNewsFolderFromUri(const char *uri); void TimerCallback(); nsCOMPtr mInputStream; - nsCOMPtr mUpdateTimer; + nsCOMPtr mUpdateTimer; }; NS_BEGIN_EXTERN_C