Bug 483754 Starting up Thunderbird with network offline doesn't work properly - improve always online and remember last state when offline.autoDetect is enabled. r/sr=bienvenu,ui-review=clarkbw
authorMark Banner <bugzilla@standard8.plus.com>
Sun, 29 Mar 2009 14:33:17 +0100
changeset 2300 fcb7cbdcfe88f0b810e2224a7adbf193aea20d30
parent 2299 054adad6539de39cabfcdf5664293f210823b447
child 2301 b309610b1f998e7a915788c43dc17e4c26f7e9b2
push idunknown
push userunknown
push dateunknown
bugs483754
Bug 483754 Starting up Thunderbird with network offline doesn't work properly - improve always online and remember last state when offline.autoDetect is enabled. r/sr=bienvenu,ui-review=clarkbw
mailnews/extensions/offline-startup/js/offlineStartup.js
--- a/mailnews/extensions/offline-startup/js/offlineStartup.js
+++ b/mailnews/extensions/offline-startup/js/offlineStartup.js
@@ -83,23 +83,29 @@ var nsOfflineStartup =
     if (gOfflineStartupMode == kAlwaysOffline)
     {
       ioService.manageOfflineStatus = false;
       ioService.offline = true;
     }
     else if (gOfflineStartupMode == kAlwaysOnline)
     {
       ioService.manageOfflineStatus = manageOfflineStatus;
-      ioService.offline = false;
+      // If we're managing the offline status, don't force online here... it may
+      // be the network really is offline.
+      if (!manageOfflineStatus)
+        ioService.offline = false;
     }
     else if (gOfflineStartupMode == kRememberLastState)
     {
       var wasOffline = !prefs.getBoolPref("network.online");
       ioService.manageOfflineStatus = manageOfflineStatus && !wasOffline;
-      ioService.offline = wasOffline;        
+      // If we are meant to be online, and managing the offline status
+      // then don't force it - it may be the network really is offline.
+      if (!manageOfflineStatus || wasOffline)
+        ioService.offline = wasOffline;
     }
     else if (gOfflineStartupMode == kAskForOnlineState)
     {
       var promptService = Components.
         classes["@mozilla.org/embedcomp/prompt-service;1"].
         getService(Components.interfaces.nsIPromptService);
 
       var bundle = getBundle(kBundleURI);