From b085b955cfced12557e89c0f2e8a706c4eb2fec3 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Sun, 16 May 1999 04:18:51 +0000 Subject: [PATCH] more work for message post to nntp server --- mailnews/news/public/nsINntpUrl.h | 6 +++++- mailnews/news/src/nsNntpUrl.cpp | 27 ++++++++++++++++++++++++++- mailnews/news/src/nsNntpUrl.h | 8 +++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/mailnews/news/public/nsINntpUrl.h b/mailnews/news/public/nsINntpUrl.h index 9025e7ffe63..b40b376231c 100644 --- a/mailnews/news/public/nsINntpUrl.h +++ b/mailnews/news/public/nsINntpUrl.h @@ -74,7 +74,11 @@ public: NS_IMETHOD SetMessageToPost (nsINNTPNewsgroupPost *post) = 0; NS_IMETHOD GetMessageToPost (nsINNTPNewsgroupPost **post) = 0; - + + // the message can be stored in a file....allow accessors for getting and setting + // the file name to post... + NS_IMETHOD SetPostMessageFile(const nsFilePath& aFileName) = 0; + NS_IMETHOD GetPostMessageFile(const nsFilePath ** aFileName) = 0; }; #endif /* nsIHttpURL_h___ */ diff --git a/mailnews/news/src/nsNntpUrl.cpp b/mailnews/news/src/nsNntpUrl.cpp index 9bf62ef7d19..400bd35f6dc 100644 --- a/mailnews/news/src/nsNntpUrl.cpp +++ b/mailnews/news/src/nsNntpUrl.cpp @@ -42,7 +42,8 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_CID(kUrlListenerManagerCID, NS_URLLISTENERMANAGER_CID); -nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup) +nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup): + m_fileName("") { NS_INIT_REFCNT(); @@ -346,6 +347,30 @@ nsresult nsNntpUrl::GetErrorMessage (char ** errorMessage) const return NS_OK; } +// the message can be stored in a file....allow accessors for getting and setting +// the file name to post... +nsresult nsNntpUrl::SetPostMessageFile(const nsFilePath& aFileName) +{ +#ifdef DEBUG_sspitzer + printf("SetPostMessageFile(%s)\n",(const char *)aFileName); +#endif + nsresult rv = NS_OK; + if (aFileName) + m_fileName = aFileName; + + return rv; +} + +nsresult nsNntpUrl::GetPostMessageFile(const nsFilePath ** aFileName) +{ + nsresult rv = NS_OK; + if (aFileName) + *aFileName = &m_fileName; + + return rv; +} + + nsresult nsNntpUrl::GetFilePath(const nsFileSpec ** aFilePath) { diff --git a/mailnews/news/src/nsNntpUrl.h b/mailnews/news/src/nsNntpUrl.h index ab4e520a8f7..f78ca961976 100644 --- a/mailnews/news/src/nsNntpUrl.h +++ b/mailnews/news/src/nsNntpUrl.h @@ -79,6 +79,11 @@ public: NS_IMETHOD SetMessageToPost(nsINNTPNewsgroupPost *post); NS_IMETHOD GetMessageToPost(nsINNTPNewsgroupPost **post); + + // the message can be stored in a file....allow accessors for getting and setting + // the file name to post... + NS_IMETHOD SetPostMessageFile(const nsFilePath& aFileName); + NS_IMETHOD GetPostMessageFile(const nsFilePath ** aFileName); NS_IMETHOD GetFilePath(const nsFileSpec ** aFilePath); @@ -116,7 +121,8 @@ protected: char *m_ref; char *m_search; char *m_errorMessage; - + nsFilePath m_fileName; + PRBool m_runningUrl; nsINNTPNewsgroupPost *m_newsgroupPost;