Bug 1337865 - White-space clean-up in nsNntpIncomingServer.cpp. rs=white-space only
authorJorg K <jorgk@jorgk.com>
Sun, 26 Feb 2017 16:05:38 +0100
changeset 27693 39ee657ffbfd508614ff577604ab750b18cf5061
parent 27692 ef7420896e68b4a9ffd30c7ad50ac0cb9c25b990
child 27694 63e348c30e234cce9f07acd76eacf99896ea47fb
push idunknown
push userunknown
push dateunknown
reviewerswhite-space
bugs1337865
Bug 1337865 - White-space clean-up in nsNntpIncomingServer.cpp. rs=white-space only
mailnews/news/src/nsNntpIncomingServer.cpp
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -814,17 +814,17 @@ nsNntpIncomingServer::WriteHostInfoFile(
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (!mHostInfoFile)
     return NS_ERROR_UNEXPECTED;
   nsCOMPtr<nsIOutputStream> hostInfoStream;
   rv = MsgNewBufferedFileOutputStream(getter_AddRefs(hostInfoStream), mHostInfoFile, -1, 00600);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // todo, missing some formatting, see the 4.x code
+  // XXX TODO: missing some formatting, see the 4.x code
   nsAutoCString header("# News host information file.");
   WriteLine(hostInfoStream, header);
   header.Assign("# This is a generated file!  Do not edit.");
   WriteLine(hostInfoStream, header);
   header.Truncate();
   WriteLine(hostInfoStream, header);
   nsAutoCString version("version=");
   version.AppendInt(VALID_VERSION);
@@ -836,17 +836,17 @@ nsNntpIncomingServer::WriteHostInfoFile(
   dateStr.AppendInt(mLastUpdatedTime);
   WriteLine(hostInfoStream, dateStr);
   dateStr = "uniqueid=";
   dateStr.AppendInt(mUniqueId);
   WriteLine(hostInfoStream, dateStr);
   header.Assign(MSG_LINEBREAK"begingroups");
   WriteLine(hostInfoStream, header);
 
-  // XXX todo, sort groups first?
+  // XXX TODO: sort groups first?
   uint32_t length = mGroupsOnServer.Length();
   for (uint32_t i = 0; i < length; ++i)
   {
     uint32_t bytesWritten;
     hostInfoStream->Write(mGroupsOnServer[i].get(), mGroupsOnServer[i].Length(),
                           &bytesWritten);
     hostInfoStream->Write(MSG_LINEBREAK, MSG_LINEBREAK_LEN, &bytesWritten);
   }
@@ -898,26 +898,24 @@ nsNntpIncomingServer::LoadHostInfoFile()
   fileStream->Close();
 
   return UpdateSubscribed();
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::StartPopulatingWithUri(nsIMsgWindow *aMsgWindow, bool aForceToServer, const char *uri)
 {
-  nsresult rv = NS_OK;
-
 #ifdef DEBUG_seth
   printf("StartPopulatingWithUri(%s)\n",uri);
 #endif
 
-    rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    rv = mInner->StartPopulatingWithUri(aMsgWindow, aForceToServer, uri);
-    NS_ENSURE_SUCCESS(rv,rv);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  rv = mInner->StartPopulatingWithUri(aMsgWindow, aForceToServer, uri);
+  NS_ENSURE_SUCCESS(rv,rv);
 
   rv = StopPopulating(mMsgWindow);
   if (NS_FAILED(rv)) return rv;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -927,21 +925,19 @@ nsNntpIncomingServer::SubscribeCleanup()
     rv = ClearInner();
     NS_ENSURE_SUCCESS(rv,rv);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::StartPopulating(nsIMsgWindow *aMsgWindow, bool aForceToServer, bool aGetOnlyNew)
 {
-  nsresult rv;
-
   mMsgWindow = aMsgWindow;
 
-  rv = EnsureInner();
+  nsresult rv = EnsureInner();
   NS_ENSURE_SUCCESS(rv,rv);
 
   rv = mInner->StartPopulating(aMsgWindow, aForceToServer, aGetOnlyNew);
   NS_ENSURE_SUCCESS(rv,rv);
 
   rv = SetDelimiter(NEWS_DELIMITER);
   if (NS_FAILED(rv)) return rv;
 
@@ -1010,89 +1006,91 @@ nsNntpIncomingServer::AddNewsgroupToList
                false, true, true);
     if (NS_FAILED(rv)) return rv;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetIncomingServer(nsIMsgIncomingServer *aServer)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
   return mInner->SetIncomingServer(aServer);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetShowFullName(bool showFullName)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
   return mInner->SetShowFullName(showFullName);
 }
 
 nsresult
 nsNntpIncomingServer::ClearInner()
 {
-    nsresult rv = NS_OK;
+  nsresult rv = NS_OK;
 
-    if (mInner) {
-        rv = mInner->SetSubscribeListener(nullptr);
-        NS_ENSURE_SUCCESS(rv,rv);
+  if (mInner) {
+    rv = mInner->SetSubscribeListener(nullptr);
+    NS_ENSURE_SUCCESS(rv,rv);
 
-        rv = mInner->SetIncomingServer(nullptr);
-        NS_ENSURE_SUCCESS(rv,rv);
+    rv = mInner->SetIncomingServer(nullptr);
+    NS_ENSURE_SUCCESS(rv,rv);
 
-        mInner = nullptr;
-    }
-    return NS_OK;
+    mInner = nullptr;
+  }
+  return NS_OK;
 }
 
 nsresult
 nsNntpIncomingServer::EnsureInner()
 {
-    nsresult rv = NS_OK;
+  nsresult rv = NS_OK;
 
-    if (mInner) return NS_OK;
+  if (mInner)
+    return NS_OK;
 
-    mInner = do_CreateInstance(kSubscribableServerCID,&rv);
-    NS_ENSURE_SUCCESS(rv,rv);
-    if (!mInner) return NS_ERROR_FAILURE;
+  mInner = do_CreateInstance(kSubscribableServerCID,&rv);
+  NS_ENSURE_SUCCESS(rv,rv);
+  if (!mInner)
+    return NS_ERROR_FAILURE;
 
-    rv = SetIncomingServer(this);
-    NS_ENSURE_SUCCESS(rv,rv);
+  rv = SetIncomingServer(this);
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    return NS_OK;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetDelimiter(char *aDelimiter)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->GetDelimiter(aDelimiter);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->GetDelimiter(aDelimiter);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetDelimiter(char aDelimiter)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->SetDelimiter(aDelimiter);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->SetDelimiter(aDelimiter);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetAsSubscribed(const nsACString &path)
 {
-    mTempSubscribed.AppendElement(path);
-    if (mGetOnlyNew && (!mGroupsOnServer.Contains(path)))
-      return NS_OK;
+  mTempSubscribed.AppendElement(path);
+  if (mGetOnlyNew && (!mGroupsOnServer.Contains(path)))
+    return NS_OK;
 
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->SetAsSubscribed(path);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->SetAsSubscribed(path);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::UpdateSubscribed()
 {
   nsresult rv = EnsureInner();
   NS_ENSURE_SUCCESS(rv,rv);
   mTempSubscribed.Clear();
@@ -1101,27 +1099,27 @@ nsNntpIncomingServer::UpdateSubscribed()
     SetAsSubscribed(mSubscribedNewsgroups[i]);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::AddTo(const nsACString &aName, bool addAsSubscribed,
                             bool aSubscribable, bool changeIfExists)
 {
-    NS_ASSERTION(MsgIsUTF8(aName), "Non-UTF-8 newsgroup name");
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
+  NS_ASSERTION(MsgIsUTF8(aName), "Non-UTF-8 newsgroup name");
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    rv = AddGroupOnServer(aName);
-    NS_ENSURE_SUCCESS(rv,rv);
+  rv = AddGroupOnServer(aName);
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    rv = mInner->AddTo(aName, addAsSubscribed, aSubscribable, changeIfExists);
-    NS_ENSURE_SUCCESS(rv,rv);
+  rv = mInner->AddTo(aName, addAsSubscribed, aSubscribable, changeIfExists);
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    return rv;
+  return rv;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::StopPopulating(nsIMsgWindow *aMsgWindow)
 {
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsISubscribeListener> listener;
@@ -1140,36 +1138,36 @@ nsNntpIncomingServer::StopPopulating(nsI
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (!mGetOnlyNew && !mHostInfoLoaded)
   {
     rv = WriteHostInfoFile();
     NS_ENSURE_SUCCESS(rv,rv);
   }
 
-  //xxx todo when do I set this to null?
-  //rv = ClearInner();
-  //NS_ENSURE_SUCCESS(rv,rv);
+  // XXX TODO: when do I set this to null?
+  // rv = ClearInner();
+  // NS_ENSURE_SUCCESS(rv,rv);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetSubscribeListener(nsISubscribeListener *aListener)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
   return mInner->SetSubscribeListener(aListener);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSubscribeListener(nsISubscribeListener **aListener)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->GetSubscribeListener(aListener);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->GetSubscribeListener(aListener);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::Subscribe(const char16_t *aUnicharName)
 {
   return SubscribeToNewsgroup(NS_ConvertUTF16toUTF8(aUnicharName));
 }
 
@@ -1220,17 +1218,17 @@ nsNntpIncomingServer::HandleLine(const c
 {
   NS_ASSERTION(line, "line is null");
   if (!line)
     return NS_OK;
 
   // skip blank lines and comments
   if (line[0] == '#' || line[0] == '\0')
     return NS_OK;
-  // ###TODO - make this truly const, maybe pass in an nsCString &
+  // XXX TODO: make this truly const, maybe pass in an nsCString &
 
   if (mHasSeenBeginGroups) {
     // v1 hostinfo files had additional data fields delimited by commas.
     // with v2 hostinfo files, the additional data fields are removed.
     char *commaPos = (char *) PL_strchr(line,',');
     if (commaPos) *commaPos = 0;
 
         // newsrc entries are all in UTF-8
@@ -1270,154 +1268,151 @@ nsNntpIncomingServer::AddGroupOnServer(c
 {
   mGroupsOnServer.AppendElement(aName);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::AddNewsgroup(const nsAString &aName)
 {
-    // handle duplicates?
-    mSubscribedNewsgroups.AppendElement(NS_ConvertUTF16toUTF8(aName));
-    return NS_OK;
+  // handle duplicates?
+  mSubscribedNewsgroups.AppendElement(NS_ConvertUTF16toUTF8(aName));
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::RemoveNewsgroup(const nsAString &aName)
 {
-    // handle duplicates?
-    mSubscribedNewsgroups.RemoveElement(NS_ConvertUTF16toUTF8(aName));
-    return NS_OK;
+  // handle duplicates?
+  mSubscribedNewsgroups.RemoveElement(NS_ConvertUTF16toUTF8(aName));
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetState(const nsACString &path, bool state,
                                bool *stateChanged)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    rv = mInner->SetState(path, state, stateChanged);
-    if (*stateChanged) {
-      if (state)
-        mTempSubscribed.AppendElement(path);
-      else
-        mTempSubscribed.RemoveElement(path);
-    }
-    return rv;
+  rv = mInner->SetState(path, state, stateChanged);
+  if (*stateChanged) {
+    if (state)
+      mTempSubscribed.AppendElement(path);
+    else
+      mTempSubscribed.RemoveElement(path);
+  }
+  return rv;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::HasChildren(const nsACString &path, bool *aHasChildren)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->HasChildren(path, aHasChildren);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->HasChildren(path, aHasChildren);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsSubscribed(const nsACString &path,
                                    bool *aIsSubscribed)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->IsSubscribed(path, aIsSubscribed);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->IsSubscribed(path, aIsSubscribed);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsSubscribable(const nsACString &path,
                                      bool *aIsSubscribable)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->IsSubscribable(path, aIsSubscribable);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->IsSubscribable(path, aIsSubscribable);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetLeafName(const nsACString &path, nsAString &aLeafName)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->GetLeafName(path, aLeafName);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->GetLeafName(path, aLeafName);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetFirstChildURI(const nsACString &path, nsACString &aResult)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->GetFirstChildURI(path, aResult);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->GetFirstChildURI(path, aResult);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetChildren(const nsACString &aPath,
                                   nsISimpleEnumerator **aResult)
 {
-    nsresult rv = EnsureInner();
-    NS_ENSURE_SUCCESS(rv,rv);
-    return mInner->GetChildren(aPath, aResult);
+  nsresult rv = EnsureInner();
+  NS_ENSURE_SUCCESS(rv,rv);
+  return mInner->GetChildren(aPath, aResult);
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::CommitSubscribeChanges()
 {
-    nsresult rv;
-
-    // we force the newrc to be dirty, so it will get written out when
-    // we call WriteNewsrcFile()
-    rv = SetNewsrcHasChanged(true);
-    NS_ENSURE_SUCCESS(rv,rv);
-    return WriteNewsrcFile();
+  // we force the newrc to be dirty, so it will get written out when
+  // we call WriteNewsrcFile()
+  nsresult rv = SetNewsrcHasChanged(true);
+  NS_ENSURE_SUCCESS(rv,rv);
+  return WriteNewsrcFile();
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::ForgetPassword()
 {
-    nsresult rv;
+  // clear password of root folder (for the news account)
+  nsCOMPtr<nsIMsgFolder> rootFolder;
+  nsresult rv = GetRootFolder(getter_AddRefs(rootFolder));
+  NS_ENSURE_SUCCESS(rv,rv);
+  if (!rootFolder) return NS_ERROR_FAILURE;
 
-    // clear password of root folder (for the news account)
-    nsCOMPtr<nsIMsgFolder> rootFolder;
-    rv = GetRootFolder(getter_AddRefs(rootFolder));
-    NS_ENSURE_SUCCESS(rv,rv);
-    if (!rootFolder) return NS_ERROR_FAILURE;
+  nsCOMPtr <nsIMsgNewsFolder> newsFolder = do_QueryInterface(rootFolder, &rv);
+  NS_ENSURE_SUCCESS(rv,rv);
+  if (!newsFolder) return NS_ERROR_FAILURE;
 
-    nsCOMPtr <nsIMsgNewsFolder> newsFolder = do_QueryInterface(rootFolder, &rv);
-    NS_ENSURE_SUCCESS(rv,rv);
-    if (!newsFolder) return NS_ERROR_FAILURE;
+  rv = newsFolder->ForgetAuthenticationCredentials();
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    rv = newsFolder->ForgetAuthenticationCredentials();
-    NS_ENSURE_SUCCESS(rv,rv);
+  // clear password of all child folders
+  nsCOMPtr<nsISimpleEnumerator> subFolders;
 
-    // clear password of all child folders
-    nsCOMPtr<nsISimpleEnumerator> subFolders;
+  rv = rootFolder->GetSubFolders(getter_AddRefs(subFolders));
+  NS_ENSURE_SUCCESS(rv,rv);
 
-    rv = rootFolder->GetSubFolders(getter_AddRefs(subFolders));
-    NS_ENSURE_SUCCESS(rv,rv);
+  bool moreFolders = false;
 
-    bool moreFolders = false;
-
-    nsresult return_rv = NS_OK;
+  nsresult return_rv = NS_OK;
 
-    while (NS_SUCCEEDED(subFolders->HasMoreElements(&moreFolders)) &&
-           moreFolders) {
-        nsCOMPtr<nsISupports> child;
-        rv = subFolders->GetNext(getter_AddRefs(child));
-        if (NS_SUCCEEDED(rv) && child) {
-            newsFolder = do_QueryInterface(child, &rv);
-            if (NS_SUCCEEDED(rv) && newsFolder) {
-                rv = newsFolder->ForgetAuthenticationCredentials();
-                if (NS_FAILED(rv)) return_rv = rv;
-            }
-            else {
-                return_rv = NS_ERROR_FAILURE;
-            }
-        }
+  while (NS_SUCCEEDED(subFolders->HasMoreElements(&moreFolders)) &&
+         moreFolders) {
+    nsCOMPtr<nsISupports> child;
+    rv = subFolders->GetNext(getter_AddRefs(child));
+    if (NS_SUCCEEDED(rv) && child) {
+      newsFolder = do_QueryInterface(child, &rv);
+      if (NS_SUCCEEDED(rv) && newsFolder) {
+        rv = newsFolder->ForgetAuthenticationCredentials();
+        if (NS_FAILED(rv))
+          return_rv = rv;
+      }
+      else {
+        return_rv = NS_ERROR_FAILURE;
+      }
     }
+  }
 
-    return return_rv;
+  return return_rv;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSupportsExtensions(bool *aSupportsExtensions)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -1542,17 +1537,16 @@ nsNntpIncomingServer::GetFirstGroupNeedi
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetGroupNeedsExtraInfo(const nsACString &name,
                                              bool needsExtraInfo)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-
 NS_IMETHODIMP
 nsNntpIncomingServer::GroupNotFound(nsIMsgWindow *aMsgWindow,
                                     const nsAString &aName, bool aOpening)
 {
   nsresult rv;
   nsCOMPtr <nsIPrompt> prompt;
 
   if (aMsgWindow) {
@@ -1606,59 +1600,59 @@ nsNntpIncomingServer::SetPrettyNameForGr
                                             const nsAString &prettyName)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetCanSearchMessages(bool *canSearchMessages)
 {
-    NS_ENSURE_ARG_POINTER(canSearchMessages);
-    *canSearchMessages = true;
-    return NS_OK;
+  NS_ENSURE_ARG_POINTER(canSearchMessages);
+  *canSearchMessages = true;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetOfflineSupportLevel(int32_t *aSupportLevel)
 {
-    NS_ENSURE_ARG_POINTER(aSupportLevel);
-    nsresult rv;
+  NS_ENSURE_ARG_POINTER(aSupportLevel);
+  nsresult rv;
 
-    rv = GetIntValue("offline_support_level", aSupportLevel);
-    if (*aSupportLevel != OFFLINE_SUPPORT_LEVEL_UNDEFINED) return rv;
+  rv = GetIntValue("offline_support_level", aSupportLevel);
+  if (*aSupportLevel != OFFLINE_SUPPORT_LEVEL_UNDEFINED) return rv;
 
-    // set default value
-    *aSupportLevel = OFFLINE_SUPPORT_LEVEL_EXTENDED;
-    return NS_OK;
+  // set default value
+  *aSupportLevel = OFFLINE_SUPPORT_LEVEL_EXTENDED;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetDefaultCopiesAndFoldersPrefsToServer(bool *aCopiesAndFoldersOnServer)
 {
-    NS_ENSURE_ARG_POINTER(aCopiesAndFoldersOnServer);
+  NS_ENSURE_ARG_POINTER(aCopiesAndFoldersOnServer);
 
-    /**
-     * When a news account is created, the copies and folder prefs for the
-     * associated identity don't point to folders on the server.
-     * This makes sense, since there is no "Drafts" folder on a news server.
-     * They'll point to the ones on "Local Folders"
-     */
+  /**
+   * When a news account is created, the copies and folder prefs for the
+   * associated identity don't point to folders on the server.
+   * This makes sense, since there is no "Drafts" folder on a news server.
+   * They'll point to the ones on "Local Folders"
+   */
 
-    *aCopiesAndFoldersOnServer = false;
-    return NS_OK;
+  *aCopiesAndFoldersOnServer = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetCanCreateFoldersOnServer(bool *aCanCreateFoldersOnServer)
 {
-    NS_ENSURE_ARG_POINTER(aCanCreateFoldersOnServer);
+  NS_ENSURE_ARG_POINTER(aCanCreateFoldersOnServer);
 
-    // No folder creation on news servers. Return false.
-    *aCanCreateFoldersOnServer = false;
-    return NS_OK;
+  // No folder creation on news servers. Return false.
+  *aCanCreateFoldersOnServer = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetSearchValue(const nsAString &aSearchValue)
 {
   nsCString searchValue = NS_ConvertUTF16toUTF8(aSearchValue);
   MsgCompressWhitespace(searchValue);
 
@@ -1698,25 +1692,25 @@ nsNntpIncomingServer::SetSearchValue(con
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSupportsSubscribeSearch(bool *retVal)
 {
-    *retVal = true;
-    return NS_OK;
+  *retVal = true;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetRowCount(int32_t *aRowCount)
 {
-    *aRowCount = mSubscribeSearchResult.Length();
-    return NS_OK;
+  *aRowCount = mSubscribeSearchResult.Length();
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSelection(nsITreeSelection * *aSelection)
 {
   *aSelection = mTreeSelection;
   NS_IF_ADDREF(*aSelection);
   return NS_OK;
@@ -1727,119 +1721,119 @@ nsNntpIncomingServer::SetSelection(nsITr
 {
   mTreeSelection = aSelection;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetRowProperties(int32_t index, nsAString& properties)
 {
-    return NS_OK;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetCellProperties(int32_t row, nsITreeColumn* col, nsAString& properties)
 {
-    if (!IsValidRow(row))
-      return NS_ERROR_UNEXPECTED;
+  if (!IsValidRow(row))
+    return NS_ERROR_UNEXPECTED;
 
-    NS_ENSURE_ARG_POINTER(col);
+  NS_ENSURE_ARG_POINTER(col);
 
-    const char16_t* colID;
-    col->GetIdConst(&colID);
-    if (colID[0] == 's') {
-        // if <name> is in our temporary list of subscribed groups
-        // add the "subscribed" property so the check mark shows up
-        // in the "subscribedCol"
-        if (mSearchResultSortDescending)
-          row = mSubscribeSearchResult.Length() - 1 - row;
-        if (mTempSubscribed.Contains(mSubscribeSearchResult.ElementAt(row))) {
-          properties.AssignLiteral("subscribed");
-        }
+  const char16_t* colID;
+  col->GetIdConst(&colID);
+  if (colID[0] == 's') {
+    // if <name> is in our temporary list of subscribed groups
+    // add the "subscribed" property so the check mark shows up
+    // in the "subscribedCol"
+    if (mSearchResultSortDescending)
+      row = mSubscribeSearchResult.Length() - 1 - row;
+    if (mTempSubscribed.Contains(mSubscribeSearchResult.ElementAt(row))) {
+      properties.AssignLiteral("subscribed");
     }
-    else if (colID[0] == 'n') {
-      // add the "nntp" property to the "nameCol"
-      // so we get the news folder icon in the search view
-      properties.AssignLiteral("nntp");
-    }
-    return NS_OK;
+  }
+  else if (colID[0] == 'n') {
+    // add the "nntp" property to the "nameCol"
+    // so we get the news folder icon in the search view
+    properties.AssignLiteral("nntp");
+  }
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetColumnProperties(nsITreeColumn* col, nsAString& properties)
 {
-    return NS_OK;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsContainer(int32_t index, bool *_retval)
 {
-    *_retval = false;
-    return NS_OK;
+  *_retval = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsContainerOpen(int32_t index, bool *_retval)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsContainerEmpty(int32_t index, bool *_retval)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsSeparator(int32_t index, bool *_retval)
 {
-    *_retval = false;
-    return NS_OK;
+  *_retval = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsSorted(bool *_retval)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::CanDrop(int32_t index,
                               int32_t orientation,
                               nsIDOMDataTransfer *dataTransfer,
                               bool *_retval)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::Drop(int32_t row,
                            int32_t orientation,
                            nsIDOMDataTransfer *dataTransfer)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetParentIndex(int32_t rowIndex, int32_t *_retval)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::HasNextSibling(int32_t rowIndex, int32_t afterIndex, bool *_retval)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetLevel(int32_t index, int32_t *_retval)
 {
-    *_retval = 0;
-    return NS_OK;
+  *_retval = 0;
+  return NS_OK;
 }
 
 bool
 nsNntpIncomingServer::IsValidRow(int32_t row)
 {
   return ((row >= 0) && (row < (int32_t)mSubscribeSearchResult.Length()));
 }
 
@@ -1859,178 +1853,178 @@ NS_IMETHODIMP
 nsNntpIncomingServer::GetCellValue(int32_t row, nsITreeColumn* col, nsAString& _retval)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetCellText(int32_t row, nsITreeColumn* col, nsAString& _retval)
 {
-    if (!IsValidRow(row))
-      return NS_ERROR_UNEXPECTED;
+  if (!IsValidRow(row))
+    return NS_ERROR_UNEXPECTED;
 
-    NS_ENSURE_ARG_POINTER(col);
+  NS_ENSURE_ARG_POINTER(col);
 
-    const char16_t* colID;
-    col->GetIdConst(&colID);
+  const char16_t* colID;
+  col->GetIdConst(&colID);
 
-    nsresult rv = NS_OK;
-    if (colID[0] == 'n') {
-      nsAutoCString str;
-      if (mSearchResultSortDescending)
-        row = mSubscribeSearchResult.Length() - 1 - row;
-      // some servers have newsgroup names that are non ASCII.  we store
-      // those as escaped. unescape here so the UI is consistent
-      rv = NS_MsgDecodeUnescapeURLPath(mSubscribeSearchResult.ElementAt(row), _retval);
-    }
-    return rv;
+  nsresult rv = NS_OK;
+  if (colID[0] == 'n') {
+    nsAutoCString str;
+    if (mSearchResultSortDescending)
+      row = mSubscribeSearchResult.Length() - 1 - row;
+    // some servers have newsgroup names that are non ASCII.  we store
+    // those as escaped. unescape here so the UI is consistent
+    rv = NS_MsgDecodeUnescapeURLPath(mSubscribeSearchResult.ElementAt(row), _retval);
+  }
+  return rv;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetTree(nsITreeBoxObject *tree)
 {
   mTree = tree;
   if (!tree)
-      return NS_OK;
+    return NS_OK;
 
   nsCOMPtr<nsITreeColumns> cols;
   tree->GetColumns(getter_AddRefs(cols));
   if (!cols)
-      return NS_OK;
+    return NS_OK;
 
   nsCOMPtr<nsITreeColumn> col;
   cols->GetKeyColumn(getter_AddRefs(col));
   if (!col)
-      return NS_OK;
+    return NS_OK;
 
   nsCOMPtr<nsIDOMElement> element;
   col->GetElement(getter_AddRefs(element));
   if (!element)
-      return NS_OK;
+    return NS_OK;
 
   nsAutoString dir;
   element->GetAttribute(NS_LITERAL_STRING("sortDirection"), dir);
   mSearchResultSortDescending = dir.EqualsLiteral("descending");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::ToggleOpenState(int32_t index)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::CycleHeader(nsITreeColumn* col)
 {
-    NS_ENSURE_ARG_POINTER(col);
+  NS_ENSURE_ARG_POINTER(col);
 
-    bool cycler;
-    col->GetCycler(&cycler);
-    if (!cycler) {
-        NS_NAMED_LITERAL_STRING(dir, "sortDirection");
-        nsCOMPtr<nsIDOMElement> element;
-        col->GetElement(getter_AddRefs(element));
-        mSearchResultSortDescending = !mSearchResultSortDescending;
-        element->SetAttribute(dir, mSearchResultSortDescending ?
-            NS_LITERAL_STRING("descending") : NS_LITERAL_STRING("ascending"));
-        mTree->Invalidate();
-    }
-    return NS_OK;
+  bool cycler;
+  col->GetCycler(&cycler);
+  if (!cycler) {
+    NS_NAMED_LITERAL_STRING(dir, "sortDirection");
+    nsCOMPtr<nsIDOMElement> element;
+    col->GetElement(getter_AddRefs(element));
+    mSearchResultSortDescending = !mSearchResultSortDescending;
+    element->SetAttribute(dir, mSearchResultSortDescending ?
+      NS_LITERAL_STRING("descending") : NS_LITERAL_STRING("ascending"));
+    mTree->Invalidate();
+  }
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SelectionChanged()
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::CycleCell(int32_t row, nsITreeColumn* col)
 {
-    return NS_OK;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsEditable(int32_t row, nsITreeColumn* col, bool *_retval)
 {
-    *_retval = false;
-    return NS_OK;
+  *_retval = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::IsSelectable(int32_t row, nsITreeColumn* col, bool *_retval)
 {
-    *_retval = false;
-    return NS_OK;
+  *_retval = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetCellValue(int32_t row, nsITreeColumn* col, const nsAString& value)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SetCellText(int32_t row, nsITreeColumn* col, const nsAString& value)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::PerformAction(const char16_t *action)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::PerformActionOnRow(const char16_t *action, int32_t row)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::PerformActionOnCell(const char16_t *action, int32_t row, nsITreeColumn* col)
 {
-    return NS_ERROR_NOT_IMPLEMENTED;
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetCanFileMessagesOnServer(bool *aCanFileMessagesOnServer)
 {
-    NS_ENSURE_ARG_POINTER(aCanFileMessagesOnServer);
+  NS_ENSURE_ARG_POINTER(aCanFileMessagesOnServer);
 
-    // No folder creation on news servers. Return false.
-    *aCanFileMessagesOnServer = false;
-    return NS_OK;
+  // No folder creation on news servers. Return false.
+  *aCanFileMessagesOnServer = false;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetFilterScope(nsMsgSearchScopeValue *filterScope)
 {
-   NS_ENSURE_ARG_POINTER(filterScope);
+  NS_ENSURE_ARG_POINTER(filterScope);
 
-   *filterScope = nsMsgSearchScope::newsFilter;
-   return NS_OK;
+  *filterScope = nsMsgSearchScope::newsFilter;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSearchScope(nsMsgSearchScopeValue *searchScope)
 {
-   NS_ENSURE_ARG_POINTER(searchScope);
+  NS_ENSURE_ARG_POINTER(searchScope);
 
-   if (WeAreOffline()) {
-     // This value is set to the localNewsBody scope to be compatible with
-     // the legacy default value.
-     *searchScope = nsMsgSearchScope::localNewsBody;
-   }
-   else {
-     *searchScope = nsMsgSearchScope::news;
-   }
-   return NS_OK;
+  if (WeAreOffline()) {
+    // This value is set to the localNewsBody scope to be compatible with
+    // the legacy default value.
+    *searchScope = nsMsgSearchScope::localNewsBody;
+  }
+  else {
+    *searchScope = nsMsgSearchScope::news;
+  }
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::GetSocketType(int32_t *aSocketType)
 {
   NS_ENSURE_ARG_POINTER(aSocketType);
   if (!mPrefBranch)
     return NS_ERROR_NOT_INITIALIZED;