From 6e6ad7cc7c7ceda9e4d1dd51b15da4e5ce51c1b5 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 14 Sep 1999 09:34:23 +0000 Subject: [PATCH] mail.root.nntp wasn't getting set when I called SetDefaultLocalPath() on a nntp incoming server because QueryInterface for nsNttpService was not fixed to support nsIMsgProtocolInfo. use the cool macro and the problem goes away. woo-hoo! --- mailnews/news/src/nsNntpService.cpp | 41 ++++------------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/mailnews/news/src/nsNntpService.cpp b/mailnews/news/src/nsNntpService.cpp index 6829860ae0c3..02f6570bfe77 100644 --- a/mailnews/news/src/nsNntpService.cpp +++ b/mailnews/news/src/nsNntpService.cpp @@ -68,42 +68,11 @@ nsNntpService::~nsNntpService() NS_IMPL_THREADSAFE_ADDREF(nsNntpService); NS_IMPL_THREADSAFE_RELEASE(nsNntpService); -nsresult nsNntpService::QueryInterface(const nsIID &aIID, void** aInstancePtr) -{ - if (nsnull == aInstancePtr) - return NS_ERROR_NULL_POINTER; - - if (aIID.Equals(NS_GET_IID(nsINntpService)) - || aIID.Equals(NS_GET_IID(nsISupports)) ) - { - *aInstancePtr = (void*) ((nsINntpService*)this); - NS_ADDREF_THIS(); - return NS_OK; - } - if (aIID.Equals(NS_GET_IID(nsIMsgMessageService))) - { - *aInstancePtr = (void*) ((nsIMsgMessageService*)this); - NS_ADDREF_THIS(); - return NS_OK; - } - if (aIID.Equals(NS_GET_IID(nsIProtocolHandler))) - { - *aInstancePtr = (void *) ((nsIProtocolHandler*) this); - NS_ADDREF_THIS(); - return NS_OK; - } - -#if defined(NS_DEBUG) - /* - * Check for the debug-only interface indicating thread-safety - */ - static NS_DEFINE_IID(kIsThreadsafeIID, NS_ISTHREADSAFE_IID); - if (aIID.Equals(kIsThreadsafeIID)) - return NS_OK; -#endif - - return NS_NOINTERFACE; -} +NS_IMPL_QUERY_INTERFACE4(nsNntpService, + nsINntpService, + nsIMsgMessageService, + nsIProtocolHandler, + nsIMsgProtocolInfo) //////////////////////////////////////////////////////////////////////////////////////// // nsIMsgMessageService support