fix for #77510. get posting a draft to work. pass in (but ignore)

the nntp posting url until I clean up the code that uses it.  sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2001-05-13 05:27:35 +00:00
parent f6369dbda5
commit a26d2332fd
5 changed files with 15 additions and 10 deletions

View File

@ -2985,7 +2985,7 @@ nsMsgComposeAndSend::DeliverFileAsNews()
if (!msgWindow) return NS_ERROR_FAILURE;
rv = nntpService->PostMessage(fileToPost, mCompFields->GetNewsgroups(), mCompFields->GetNewshost(), uriListener, msgWindow, nsnull);
rv = nntpService->PostMessage(fileToPost, mCompFields->GetNewsgroups(), mCompFields->GetNewspostUrl(), uriListener, msgWindow, nsnull);
if (NS_FAILED(rv)) return rv;
}

View File

@ -49,9 +49,9 @@ interface nsINntpService : nsISupports {
*/
void generateNewsHeaderValsForPosting(in string newsgroupsList, out string newsgroupsHeaderVal, out string newshostHeaderVal);
nsIURI postMessage (in nsIFileSpec fileToPost, in string newsgroupNames, in string newshostName, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow);
nsIURI postMessage(in nsIFileSpec fileToPost, in string newsgroupNames, in string newspostingUrl, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow);
nsIURI getNewNews (in nsINntpIncomingServer nntpServer, in string uri, in boolean getOld, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow);
nsIURI getNewNews(in nsINntpIncomingServer nntpServer, in string uri, in boolean getOld, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow);
nsIURI cancelMessage(in string cancelURL, in string messageURI, in nsISupports aConsumer, in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow);

View File

@ -528,6 +528,7 @@ NS_IMETHODIMP nsNNTPProtocol::Initialize(nsIURI * aURL, nsIMsgWindow *aMsgWindow
else {
rv = OpenNetworkSocket(m_url, nsnull, ir);
}
NS_ENSURE_SUCCESS(rv,rv);
m_nextState = NNTP_LOGIN_RESPONSE;
}
else {

View File

@ -591,13 +591,20 @@ nsresult nsNntpService::FindHostFromGroup(nsCString &host, nsCString &groupName)
}
nsresult
nsNntpService::SetUpNntpUrlForPosting(nsINntpUrl *nntpUrl, const char *newsgroupsNames, const char *newshost, char **newsUrlSpec)
nsNntpService::SetUpNntpUrlForPosting(nsINntpUrl *nntpUrl, const char *newsgroupsNames, const char *newspostingUrl, char **newsUrlSpec)
{
nsresult rv = NS_OK;
NS_ENSURE_ARG_POINTER(nntpUrl);
NS_ENSURE_ARG_POINTER(newsgroupsNames);
if (*newsgroupsNames == '\0') return NS_ERROR_FAILURE;
// XXX TODO rewrite this
// instead of using the hostname, we need to keep track of the current server id
// if newspostingUrl is non-null, we'll use that to determine the initial currentServer
// before we do that, I need to make sure the newspostingUrl we pass in is correct.
// until then, it is going to be safer to ignore it and try to determine the posting host
// from the newsgroups.
nsCAutoString host;
// newsgroupsNames can be a comma seperated list of these:
@ -644,9 +651,6 @@ nsNntpService::SetUpNntpUrlForPosting(nsINntpUrl *nntpUrl, const char *newsgroup
theRest.Left(currentHost, slashpos);
theRest.Right(currentGroup, slashpos);
}
else if (newshost && (*newshost != '\0')) {
currentHost.Assign(newshost);
}
else {
// str is "group"
rv = FindHostFromGroup(currentHost, str);
@ -824,7 +828,7 @@ nsNntpService::GenerateNewsHeaderValsForPosting(const char *newsgroupsList, char
}
NS_IMETHODIMP
nsNntpService::PostMessage(nsIFileSpec *fileToPost, const char *newsgroupsNames, const char *newshost, nsIUrlListener * aUrlListener, nsIMsgWindow *aMsgWindow, nsIURI **_retval)
nsNntpService::PostMessage(nsIFileSpec *fileToPost, const char *newsgroupsNames, const char *newspostingUrl, nsIUrlListener * aUrlListener, nsIMsgWindow *aMsgWindow, nsIURI **_retval)
{
NS_ENSURE_ARG_POINTER(aMsgWindow);
NS_ENSURE_ARG_POINTER(newsgroupsNames);
@ -843,7 +847,7 @@ nsNntpService::PostMessage(nsIFileSpec *fileToPost, const char *newsgroupsNames,
NS_ENSURE_SUCCESS(rv,rv);
nsXPIDLCString newsUrlSpec;
rv = SetUpNntpUrlForPosting(nntpUrl, newsgroupsNames, newshost, getter_Copies(newsUrlSpec));
rv = SetUpNntpUrlForPosting(nntpUrl, newsgroupsNames, newspostingUrl, getter_Copies(newsUrlSpec));
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsurl = do_QueryInterface(nntpUrl, &rv);

View File

@ -69,7 +69,7 @@ public:
protected:
PRBool WeAreOffline();
nsresult SetUpNntpUrlForPosting(nsINntpUrl * nntpUrl, const char *newsgroupNames, const char *newshost, char **newsUrlSpec);
nsresult SetUpNntpUrlForPosting(nsINntpUrl * nntpUrl, const char *newsgroupNames, const char *newspostingUrl, char **newsUrlSpec);
nsresult FindHostFromGroup(nsCString &host, nsCString &groupName);
nsresult FindServerWithNewsgroup(nsCString &host, nsCString &groupName);