implement nsIMsgProtocolInfo in news

This commit is contained in:
alecf%netscape.com 1999-09-13 23:53:33 +00:00
parent ddab31885b
commit f9e4ffdaf0
2 changed files with 32 additions and 3 deletions

View File

@ -34,6 +34,7 @@
#include "nsIMessage.h"
#include "nsINetSupportDialogService.h"
#include "nsIPref.h"
#include "nsIProfile.h"
#include "nsCRT.h" // for nsCRT::strtok
#include "nsNntpService.h"
#include "nsIChannel.h"
@ -966,3 +967,27 @@ NS_IMETHODIMP nsNntpService::NewChannel(const char *verb, nsIURI *aURI, nsILoadG
return rv;
}
NS_IMETHODIMP
nsNntpService::GetDefaultLocalPath(nsIFileSpec ** aResult)
{
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefs, kCPrefServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = prefs->GetFilePref("mail.root.nntp", aResult);
if (NS_SUCCEEDED(rv)) return rv;
NS_WITH_SERVICE(nsIProfile, profile, NS_PROFILE_PROGID, &rv);
if (NS_FAILED(rv)) return rv;
nsFileSpec dir;
rv = profile->GetCurrentProfileDir(&dir);
if (NS_FAILED(rv)) return rv;
dir += "News";
rv = NS_NewFileSpecWithSpec(dir, aResult);
return rv;
}

View File

@ -25,19 +25,23 @@
#include "nsINntpIncomingServer.h"
#include "nsIFileSpec.h"
#include "MailNewsTypes.h"
#include "nsIMsgProtocolInfo.h"
class nsIURI;
class nsIUrlListener;
class nsNntpService : public nsINntpService, public nsIMsgMessageService, public nsIProtocolHandler
class nsNntpService : public nsINntpService,
public nsIMsgMessageService,
public nsIProtocolHandler,
public nsIMsgProtocolInfo
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSINNTPSERVICE
NS_DECL_NSIMSGMESSAGESERVICE
NS_DECL_NSIPROTOCOLHANDLER
NS_DECL_ISUPPORTS
NS_DECL_NSIMSGPROTOCOLINFO
// nsNntpService
nsNntpService();