diff --git a/mailnews/news/src/nsNntpUrl.cpp b/mailnews/news/src/nsNntpUrl.cpp index fb443af1200..ca969d2b76a 100644 --- a/mailnews/news/src/nsNntpUrl.cpp +++ b/mailnews/news/src/nsNntpUrl.cpp @@ -48,10 +48,11 @@ nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup) m_offlineNews = nsnull; m_newsgroupList = nsnull; m_errorMessage = nsnull; - + // nsINetLibUrl specific state m_URL_s = nsnull; - + m_messageToPost = nsnull; + // nsIURL specific state m_protocol = nsnull; m_host = nsnull; @@ -74,6 +75,7 @@ nsNntpUrl::~nsNntpUrl() NS_IF_RELEASE(m_newsgroup); NS_IF_RELEASE(m_offlineNews); NS_IF_RELEASE(m_newsgroupList); + PR_FREEIF(m_messageToPost); PR_FREEIF(m_errorMessage); PR_FREEIF(m_spec); @@ -898,6 +900,25 @@ nsresult nsNntpUrl::ToString(PRUnichar* *aString) const return NS_OK; } +nsresult nsNntpUrl::SetMessageToPost(char *aString) +{ + NS_LOCK_INSTANCE(); + PR_FREEIF(m_messageToPost); + m_messageToPost = PL_strdup(aString); + NS_UNLOCK_INSTANCE(); + return NS_OK; +} + +nsresult nsNntpUrl::GetMessageToPost(char **aString) +{ + NS_LOCK_INSTANCE(); + char *result; + if (!aString) return NS_ERROR_NULL_POINTER; + *aString = PL_strdup(m_messageToPost); + NS_UNLOCK_INSTANCE(); + return NS_OK; +} + //////////////////////////////////////////////////////////////////////////////////// // End of functions which should be made obsolete after modifying nsIURL -//////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file +//////////////////////////////////////////////////////////////////////////////////// diff --git a/mailnews/news/src/nsNntpUrl.h b/mailnews/news/src/nsNntpUrl.h index 1e7f7e11eed..9d9cf5013e2 100644 --- a/mailnews/news/src/nsNntpUrl.h +++ b/mailnews/news/src/nsNntpUrl.h @@ -81,6 +81,8 @@ public: // caller must free using PR_FREE NS_IMETHOD GetErrorMessage (char ** errorMessage) const; + NS_IMETHOD SetMessageToPost(char *messageToPost); + NS_IMETHOD GetMessageToPost(char **messageToPost); // nsNntpUrl nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup); @@ -103,7 +105,9 @@ protected: char *m_ref; char *m_search; char *m_errorMessage; - + char *m_messageToPost; // temp char buffer of message to post + // (eventually probably a message + // instance of some kind) PRInt32 m_port; nsISupports* m_container; @@ -117,4 +121,4 @@ protected: void ReconstructSpec(void); }; -#endif // nsNntpUrl_h__ \ No newline at end of file +#endif // nsNntpUrl_h__