Bug 468444 - "Make definitions for default port constants on our various protocols consistent and accessible from script" [r+sr=neil]
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 08 Dec 2008 21:13:52 +0000
changeset 1381 1b1c9e4ebf3d52fdc99e4d6a18d998d203b90340
parent 1380 b1f9b3a6a42b2d896c99d3acf049389dd17f2b2f
child 1382 f8e9f21778d5f9e6c3b4c86fb7f951cd24e43dd7
push id1088
push userbugzilla@standard8.plus.com
push dateMon, 08 Dec 2008 21:14:40 +0000
treeherdercomm-central@1b1c9e4ebf3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs468444
Bug 468444 - "Make definitions for default port constants on our various protocols consistent and accessible from script" [r+sr=neil]
mailnews/base/util/nsMsgUtils.cpp
mailnews/compose/public/nsISmtpUrl.idl
mailnews/imap/public/nsIImapUrl.idl
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapService.cpp
mailnews/local/public/nsIPop3URL.idl
mailnews/local/src/nsPop3Service.cpp
mailnews/news/public/nsINntpUrl.idl
mailnews/news/src/nsNNTPNewsgroupList.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNewsFolder.cpp
mailnews/news/src/nsNntpService.cpp
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -78,16 +78,17 @@
 #include "nsIMsgMessageService.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIOutputStream.h"
 #include "nsMsgFileStream.h"
 #include "nsIFileURL.h"
 #include "nsNetUtil.h"
 #include "nsIMsgDatabase.h"
 #include "nsIMutableArray.h"
+#include "nsIMsgMailNewsUrl.h"
 
 static NS_DEFINE_CID(kImapUrlCID, NS_IMAPURL_CID);
 static NS_DEFINE_CID(kCMailboxUrl, NS_MAILBOXURL_CID);
 static NS_DEFINE_CID(kCNntpUrlCID, NS_NNTPURL_CID);
 
 #define ILLEGAL_FOLDER_CHARS ";#"
 #define ILLEGAL_FOLDER_CHARS_AS_FIRST_LETTER "."
 #define ILLEGAL_FOLDER_CHARS_AS_LAST_LETTER  ".~ "
--- a/mailnews/compose/public/nsISmtpUrl.idl
+++ b/mailnews/compose/public/nsISmtpUrl.idl
@@ -91,18 +91,21 @@ interface nsISmtpUrl : nsISupports {
    */
   attribute nsIMsgIdentity senderIdentity;
   attribute nsIPrompt prompt;
   attribute nsIAuthPrompt authPrompt;
   attribute nsIInterfaceRequestor notificationCallbacks;
   attribute nsISmtpServer smtpServer;
 
   attribute boolean verifyLogon; // we're just verifying the ability to logon
-    
+
+  /// Constant for the default SMTP port number
   const PRInt32 DEFAULT_SMTP_PORT = 25;
+
+  /// Constant for the default SMTP over ssl port number
   const PRInt32 DEFAULT_SMTPS_PORT = 465;
 };
 
 [scriptable, uuid(5EE2AFF7-9C6F-11d3-98A3-001083010E9B)]
 interface nsIMailtoUrl : nsISupports {
   /**
    * mailto: parse specific getters
    *
--- a/mailnews/imap/public/nsIImapUrl.idl
+++ b/mailnews/imap/public/nsIImapUrl.idl
@@ -1,9 +1,9 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -55,17 +55,17 @@ typedef long nsImapContentModifiedType;
 interface nsImapContentModifiedTypes
 {
   const long IMAP_CONTENT_NOT_MODIFIED = 0;
   const long IMAP_CONTENT_MODIFIED_VIEW_INLINE = 1;
   const long IMAP_CONTENT_MODIFIED_VIEW_AS_LINKS = 2;
   const long IMAP_CONTENT_FORCE_CONTENT_NOT_MODIFIED = 3;
 } ;
 
-[scriptable, uuid(be01aef6-f8c1-49b5-ae98-7f2be1977e50)]
+[scriptable, uuid(c9e4e0ab-f48b-4bba-b9a2-e889cbec364f)]
 interface nsIImapUrl : nsISupports
 {
   ///////////////////////////////////////////////////////////////////////////////
   // Getters and Setters for the imap specific event sinks to bind to to the url
   ///////////////////////////////////////////////////////////////////////////////
   attribute nsIImapMailFolderSink imapMailFolderSink;
   attribute nsIImapMessageSink imapMessageSink;
   attribute nsIImapServerSink imapServerSink;
@@ -182,14 +182,15 @@ interface nsIImapUrl : nsISupports
   const long nsImapSaveMessageToDisk = 0x10000030;
   const long nsImapOpenMimePart = 0x10000031;
   const long nsImapMsgDownloadForOffline  = 0x10000032;
   const long nsImapDeleteFolderAndMsgs = 0x10000033;
   const long nsImapUserDefinedMsgCommand = 0x10000034;
   const long nsImapUserDefinedFetchAttribute = 0x10000035;
   const long nsImapMsgFetchPeek = 0x10000036;
   const long nsImapMsgStoreCustomKeywords = 0x10000037;
-};
+
+  /// Constant for the default IMAP port number
+  const PRInt32 DEFAULT_IMAP_PORT = 143;
 
-%{C++
-#define IMAP_PORT 143
-#define SECURE_IMAP_PORT 993
-%}
+  /// Constant for the default IMAP over ssl port number
+  const PRInt32 DEFAULT_IMAPS_PORT = 993;
+};
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -798,19 +798,19 @@ nsresult nsImapProtocol::SetupWithUrl(ns
       // extract the file name and create a file transport...
       PRInt32 port=-1;
       server->GetPort(&port);
 
       if (port <= 0)
       {
         PRInt32 socketType;
         // Be a bit smarter about setting the default port
-        port = (NS_SUCCEEDED(server->GetSocketType(&socketType))
-                  && socketType == nsIMsgIncomingServer::useSSL)
-           ? SECURE_IMAP_PORT :IMAP_PORT;
+        port = (NS_SUCCEEDED(server->GetSocketType(&socketType)) &&
+                socketType == nsIMsgIncomingServer::useSSL) ?
+               nsIImapUrl::DEFAULT_IMAPS_PORT : nsIImapUrl::DEFAULT_IMAP_PORT;
       }
       nsCAutoString hostName;
       nsCOMPtr<nsISocketTransportService> socketService = 
                do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
       if (NS_SUCCEEDED(rv) && aURL)
       {
         aURL->GetPort(&port);
         server->GetRealHostName(hostName);
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -1302,23 +1302,23 @@ nsresult nsImapService::CreateStartOfIma
   rv = aImapMailFolder->GetHostname(hostname);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = aImapMailFolder->GetUsername(username);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!username.IsEmpty())
     *((char **)getter_Copies(escapedUsername)) = nsEscape(username.get(), url_XAlphas);
   
-  PRInt32 port = IMAP_PORT;
+  PRInt32 port = nsIImapUrl::DEFAULT_IMAP_PORT;
   nsCOMPtr<nsIMsgIncomingServer> server;
   rv = aImapMailFolder->GetServer(getter_AddRefs(server));
   if (NS_SUCCEEDED(rv)) 
   {
     server->GetPort(&port);
-    if (port == -1 || port == 0) port = IMAP_PORT;
+    if (port == -1 || port == 0) port = nsIImapUrl::DEFAULT_IMAP_PORT;
   }
   
   // now we need to create an imap url to load into the connection. The url
   // needs to represent a select folder action. 
   rv = CallCreateInstance(kImapUrlCID, imapUrl);
   if (NS_SUCCEEDED(rv) && *imapUrl)
   {
     nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(*imapUrl, &rv);
@@ -2436,17 +2436,17 @@ NS_IMETHODIMP nsImapService::GetScheme(n
 {
   aScheme.Assign("imap");
   return NS_OK; 
 }
 
 NS_IMETHODIMP nsImapService::GetDefaultPort(PRInt32 *aDefaultPort)
 {
   NS_ENSURE_ARG_POINTER(aDefaultPort);
-  *aDefaultPort = IMAP_PORT;
+  *aDefaultPort = nsIImapUrl::DEFAULT_IMAP_PORT;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImapService::GetProtocolFlags(PRUint32 *result)
 {
   *result = URI_STD | URI_FORBIDS_AUTOMATIC_DOCUMENT_REPLACEMENT |
   URI_DANGEROUS_TO_LOAD | ALLOWS_PROXY;
   return NS_OK;
@@ -2468,17 +2468,17 @@ NS_IMETHODIMP nsImapService::GetDefaultD
 }
 
 NS_IMETHODIMP nsImapService::GetDefaultServerPort(PRBool isSecure, PRInt32 *aDefaultPort)
 {
   nsresult rv = NS_OK;
   
   // Return Secure IMAP Port if secure option chosen i.e., if isSecure is TRUE
   if (isSecure)
-    *aDefaultPort = SECURE_IMAP_PORT;
+    *aDefaultPort = nsIImapUrl::DEFAULT_IMAPS_PORT;
   else    
     rv = GetDefaultPort(aDefaultPort);
   
   return rv;
 }
 
 // this method first tries to find an exact username and hostname match with the given url
 // then, tries to find any account on the passed in imap host in case this is a url to 
--- a/mailnews/local/public/nsIPop3URL.idl
+++ b/mailnews/local/public/nsIPop3URL.idl
@@ -1,9 +1,9 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -33,14 +33,19 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 #include "nsIPop3Sink.idl"
 
-[scriptable, uuid(73c043d0-b7e2-11d2-ab5c-00805f8ac968)]
+[scriptable, uuid(5fb87ae7-a3a0-440a-8b49-6bca42fb7ff2)]
 interface nsIPop3URL : nsISupports {
-    attribute nsIPop3Sink pop3Sink;
-    attribute string messageUri;
+  attribute nsIPop3Sink pop3Sink;
+  attribute string messageUri;
+
+  /// Constant for the default POP3 port number
+  const PRInt32 DEFAULT_POP3_PORT = 110;
+
+  /// Constant for the default POP3 over ssl port number
+  const PRInt32 DEFAULT_POP3S_PORT = 995;
 };
-
--- a/mailnews/local/src/nsPop3Service.cpp
+++ b/mailnews/local/src/nsPop3Service.cpp
@@ -62,19 +62,16 @@
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgAccount.h"
 #include "nsLocalMailFolder.h"
 #include "nsIMailboxUrl.h"
 #include "nsInt64.h"
 #include "nsIPrompt.h"
 #include "nsLocalStrings.h"
 
-#define POP3_PORT 110 // The IANA port for Pop3
-#define SECURE_POP3_PORT 995 // The port for Pop3 over SSL
-
 #define PREF_MAIL_ROOT_POP3 "mail.root.pop3"        // old - for backward compatibility only
 #define PREF_MAIL_ROOT_POP3_REL "mail.root.pop3-rel"
 
 static NS_DEFINE_CID(kPop3UrlCID, NS_POP3URL_CID);
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
 
 nsPop3Service::nsPop3Service()
 {
@@ -309,17 +306,17 @@ NS_IMETHODIMP nsPop3Service::GetScheme(n
 {
     aScheme = "pop3";
     return NS_OK;
 }
 
 NS_IMETHODIMP nsPop3Service::GetDefaultPort(PRInt32 *aDefaultPort)
 {
     NS_ENSURE_ARG_POINTER(aDefaultPort);
-    *aDefaultPort = POP3_PORT;
+    *aDefaultPort = nsIPop3URL::DEFAULT_POP3_PORT;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsPop3Service::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval)
 {
     *_retval = PR_TRUE; // allow pop on any port
     return NS_OK;
 }
@@ -405,17 +402,17 @@ NS_IMETHODIMP nsPop3Service::NewURI(cons
     if (NS_FAILED(rv)) return rv;
     nsCString hostname;
     nsCString username;
     server->GetHostName(hostname);
     server->GetUsername(username);
 
     PRInt32 port;
     server->GetPort(&port);
-    if (port == -1) port = POP3_PORT;
+    if (port == -1) port = nsIPop3URL::DEFAULT_POP3_PORT;
 
     // we need to escape the username because it may contain
     // characters like / % or @
     nsCString escapedUsername;
     *((char **)getter_Copies(escapedUsername)) =
       nsEscape(username.get(), url_XAlphas);
 
     nsCAutoString popSpec("pop://");
@@ -642,17 +639,17 @@ nsPop3Service::GetShowComposeMsgLink(PRB
 
 NS_IMETHODIMP
 nsPop3Service::GetDefaultServerPort(PRBool isSecure, PRInt32 *aPort)
 {
     NS_ENSURE_ARG_POINTER(aPort);
     nsresult rv = NS_OK;
 
     if (isSecure)
-      *aPort = SECURE_POP3_PORT;
+      *aPort = nsIPop3URL::DEFAULT_POP3S_PORT;
     else
       rv = GetDefaultPort(aPort);
 
     return rv;
 }
 
 NS_IMETHODIMP
 nsPop3Service::GetSpecialFoldersDeletionAllowed(PRBool *specialFoldersDeletionAllowed)
--- a/mailnews/news/public/nsINntpUrl.idl
+++ b/mailnews/news/public/nsINntpUrl.idl
@@ -1,9 +1,9 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
@@ -33,30 +33,22 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 #include "MailNewsTypes2.idl"
 
-%{ C++
-#include "nsINNTPNewsgroupPost.h"
-#include "nsIMsgMailNewsUrl.h"
-
-#define NEWS_PORT 119
-#define SECURE_NEWS_PORT 563
-%}
-
 interface nsIMsgDBHdr;
 interface nsINNTPNewsgroupPost;
 
 typedef long nsNewsAction;
 
-[scriptable, uuid(CAB8B3DF-9F66-4B36-838E-BB59950A2349)]
+[scriptable, uuid(b8bb6567-7433-4a52-beae-20e8122deb78)]
 interface nsINntpUrl : nsISupports {
   attribute nsINNTPNewsgroupPost messageToPost;
   attribute nsNewsAction newsAction;
   attribute boolean getOldMessages;
 
   const nsNewsAction ActionUnknown = 0;
   const nsNewsAction ActionGetNewNews = 1;
   const nsNewsAction ActionFetchArticle = 2;
@@ -64,9 +56,15 @@ interface nsINntpUrl : nsISupports {
   const nsNewsAction ActionCancelArticle = 4;
   const nsNewsAction ActionPostArticle = 5;
   const nsNewsAction ActionSearch = 6;
   const nsNewsAction ActionUpdateCounts = 7;
   const nsNewsAction ActionListGroups = 8;
   const nsNewsAction ActionFetchPart = 9;
   const nsNewsAction ActionAutoSubscribe = 10;
   const nsNewsAction ActionListIds = 11;
+
+  /// Constant for the default NNTP over ssl port number
+  const PRInt32 DEFAULT_NNTP_PORT = 119;
+
+  /// Constant for the default NNTP over ssl port number
+  const PRInt32 DEFAULT_NNTPS_PORT = 563;
 };
--- a/mailnews/news/src/nsNNTPNewsgroupList.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp
@@ -49,17 +49,17 @@
 #include "msgCore.h"    // precompiled header...
 #include "MailNewsTypes.h"
 #include "nsCOMPtr.h"
 #include "nsIDBFolderInfo.h"
 #include "nsINewsDatabase.h"
 #include "nsIMsgStatusFeedback.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMWindowInternal.h"
-
+#include "nsIMsgMailNewsUrl.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsINntpIncomingServer.h"
 #include "nsMsgBaseCID.h"
 
 #include "nsNNTPNewsgroupList.h"
 
 #include "nsINNTPArticleList.h"
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -45,27 +45,27 @@
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG /* Allow logging in the release build (sorry this breaks the PCH) */
 #endif
 
 #include "msgCore.h"    // precompiled header...
 #include "MailNewsTypes.h"
 #include "nntpCore.h"
 #include "nsNetUtil.h"
-
+#include "nsIMsgMailNewsUrl.h"
 #include "nsIMsgHdr.h"
 #include "nsNNTPProtocol.h"
 #include "nsINNTPArticleList.h"
 #include "nsIOutputStream.h"
 #include "nsIMemory.h"
 #include "nsIPipe.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
 #include "nsMsgI18N.h"
-
+#include "nsINNTPNewsgroupPost.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgNewsCID.h"
 
 #include "nsINntpUrl.h"
 #include "prmem.h"
 #include "prtime.h"
 #include "prlog.h"
 #include "prerror.h"
@@ -431,17 +431,17 @@ NS_IMETHODIMP nsNNTPProtocol::Initialize
   PRInt32 port = 0;
   rv = m_url->GetPort(&port);
   if (NS_FAILED(rv) || (port<=0)) {
     rv = server->GetPort(&port);
     if (NS_FAILED(rv)) return rv;
 
     if (port<=0) {
       port = (socketType == nsIMsgIncomingServer::useSSL) ?
-             SECURE_NEWS_PORT : NEWS_PORT;
+             nsINntpUrl::DEFAULT_NNTPS_PORT : nsINntpUrl::DEFAULT_NNTP_PORT;
     }
 
     rv = m_url->SetPort(port);
     if (NS_FAILED(rv)) return rv;
   }
 
   NS_PRECONDITION(m_url , "invalid URL passed into NNTP Protocol");
 
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -40,17 +40,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "prlog.h"
 
 #include "msgCore.h"    // precompiled header...
 #include "nntpCore.h"
-
+#include "nsIMsgMailNewsUrl.h"
 #include "nsNewsFolder.h"
 #include "nsMsgFolderFlags.h"
 #include "prprf.h"
 #include "prsystem.h"
 #include "nsIArray.h"
 #include "nsIServiceManager.h"
 #include "nsIEnumerator.h"
 #include "nsINntpService.h"
@@ -1100,17 +1100,17 @@ nsresult nsMsgNewsFolder::CreateNewsgrou
     rv = GetServer(getter_AddRefs(server));
     NS_ENSURE_SUCCESS(rv, rv);
 
     PRInt32 socketType;
     nsresult rv = server->GetSocketType(&socketType);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = url->SetPort((socketType == nsIMsgIncomingServer::useSSL) ?
-                      SECURE_NEWS_PORT: NEWS_PORT);
+                      nsINntpUrl::DEFAULT_NNTPS_PORT : nsINntpUrl::DEFAULT_NNTP_PORT);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = url->SetRef(nsDependentCString(ref));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return url->GetSpec(result);
 }
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -82,16 +82,17 @@
 #include "prprf.h"
 #include "nsICacheService.h"
 #include "nsICacheEntryDescriptor.h"
 #include "nsMsgUtils.h"
 #include "nsEscape.h"
 #include "nsNetUtil.h"
 #include "nsIWindowWatcher.h"
 #include "nsICommandLine.h"
+#include "nsIMsgMailNewsUrl.h"
 
 #undef GetPort  // XXX Windows!
 #undef SetPort  // XXX Windows!
 
 #define PREF_MAIL_ROOT_NNTP   "mail.root.nntp"        // old - for backward compatibility only
 #define PREF_MAIL_ROOT_NNTP_REL   "mail.root.nntp-rel"
 
 nsNntpService::nsNntpService()
@@ -295,17 +296,17 @@ nsNntpService::DisplayMessage(const char
     // "message not available" message.
     rv = folder->GetServer(getter_AddRefs(server));
     NS_ENSURE_SUCCESS(rv, rv);
 
     PRInt32 socketType;
     nsresult rv = server->GetSocketType(&socketType);
     NS_ENSURE_SUCCESS(rv, rv);
     url->SetPort((socketType == nsIMsgIncomingServer::useSSL) ?
-                 SECURE_NEWS_PORT : NEWS_PORT);
+                 nsINntpUrl::DEFAULT_NNTPS_PORT : nsINntpUrl::DEFAULT_NNTP_PORT);
 
     folder->ShouldStoreMsgOffline(key, &shouldStoreMsgOffline);
 
     // Look for the message in the offline cache
     PRBool hasMsgOffline = PR_FALSE;
     folder->HasMsgOffline(key, &hasMsgOffline);
 
     // Now look in the memory cache
@@ -1166,17 +1167,17 @@ nsNntpService::GetProtocolForUri(nsIURI 
 
   if (NS_FAILED(rv) || !server)
   {
     PRBool useSSL = PR_FALSE;
     if (PL_strcasecmp("snews", scheme.get()) == 0)
     {
       useSSL = PR_TRUE;
       if ((port == 0) || (port == -1))
-          port = SECURE_NEWS_PORT;
+          port = nsINntpUrl::DEFAULT_NNTPS_PORT;
     }
     rv = CreateNewsAccount(hostName.get(), useSSL, port, getter_AddRefs(server));
   }
 
   if (NS_FAILED(rv)) return rv;
   if (!server) return NS_ERROR_FAILURE;
 
   nntpServer = do_QueryInterface(server, &rv);
@@ -1341,34 +1342,34 @@ NS_IMETHODIMP nsNntpService::GetDefaultD
     // by default, don't do biff for NNTP servers
     *aDoBiff = PR_FALSE;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpService::GetDefaultPort(PRInt32 *aDefaultPort)
 {
     NS_ENSURE_ARG_POINTER(aDefaultPort);
-    *aDefaultPort = NEWS_PORT;
+    *aDefaultPort = nsINntpUrl::DEFAULT_NNTP_PORT;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpService::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval)
 {
     *_retval = PR_TRUE; // allow news on any port
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpService::GetDefaultServerPort(PRBool aUseSSL, PRInt32 *aDefaultPort)
 {
     nsresult rv = NS_OK;
 
     // Return Secure NNTP Port if secure option chosen i.e., if useSSL is TRUE.
     if (aUseSSL)
-        *aDefaultPort = SECURE_NEWS_PORT;
+        *aDefaultPort = nsINntpUrl::DEFAULT_NNTPS_PORT;
     else
         rv = GetDefaultPort(aDefaultPort);
 
     return rv;
 }
 
 NS_IMETHODIMP nsNntpService::GetProtocolFlags(PRUint32 *aUritype)
 {
@@ -1600,17 +1601,17 @@ nsNntpService::StreamMessage(const char 
         rv = folder->GetServer(getter_AddRefs(server));
         NS_ENSURE_SUCCESS(rv, rv);
 
         PRInt32 socketType;
         rv = server->GetSocketType(&socketType);
         NS_ENSURE_SUCCESS(rv, rv);
 
         url->SetPort((socketType == nsIMsgIncomingServer::useSSL) ?
-                     SECURE_NEWS_PORT : NEWS_PORT);
+                     nsINntpUrl::DEFAULT_NNTPS_PORT : nsINntpUrl::DEFAULT_NNTP_PORT);
 
         rv = IsMsgInMemCache(url, folder, nsnull, &hasMsgOffline);
         NS_ENSURE_SUCCESS(rv, rv);
       }
 
       // Return with an error if we didn't find it in the memory cache either
       if (!hasMsgOffline)
         return NS_ERROR_FAILURE;