rem:  offlineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"].getService(Components.interfaces.nsIMsgOfflineManager);  
context: function MailCheckBeforeOfflineChange(){  var ioService = Components.classes["@mozilla.org/network/io-service;1"]                            .getService(Components.interfaces.nsIIOService);  var goingOnline = ioService.offline;  offlineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"].getService(Components.interfaces.nsIMsgOfflineManager);  var bundle = srGetStrBundle("chrome://communicator/locale/utilityOverlay.properties");  var offlineManager = Components.classes["@mozilla.org/messenger/offline-manager;1"].getService(Components.interfaces.nsIMsgOfflineManager);  var args = {result: 0};  messenger.SetWindow(window, msgWindow);  if (!gPrefs) GetPrefsService();  var prefSendUnsentMessages = gPrefs.GetIntPref("offline.send.unsent_messages");  var prefDownloadMessages   = gPrefs.GetIntPref("offline.download.download_messages");  // dump("prefSendUnsentMessages" + prefSendUnsentMessages + "\n");  // dump("prefDownloadMessages" + prefDownloadMessages + "\n");  if(goingOnline) {    switch(prefSendUnsentMessages) {	      case 0:	window.openDialog("chrome://messenger/content/sendMsgs.xul", "sendUnsentMessages", 		"centerscreen,chrome,modal,titlebar,resizable=no", args);	if(args.result == 1) {           offlineManager.goOnline(true, true, msgWindow);	}	else if(args.result == 2) { 	  offlineManager.goOnline(false, true, msgWindow);	}	else if(args.result == 3) { 	  return false;	}	break;      case 1:        offlineManager.goOnline(true, true, msgWindow);	break;      case 2:        offlineManager.goOnline(false, true, msgWindow);	break;    }  }  else {    // going offline     switch(prefDownloadMessages) {	       case 0:	 window.openDialog("chrome://messenger/content/downloadMsgs.xul", "downloadMessages", 		"centerscreen,chrome,modal,titlebar,resizable=no", args);	 if(args.result == 1) { 	   // download news, download mail, send unsent messages, go offline when done, msg window	   offlineManager.synchronizeForOffline(false, true, false, true, msgWindow);	 }	 else if(args.result == 2) { 	   // download news, download mail, send unsent messages, go offline when done, msg window	   offlineManager.synchronizeForOffline(false, false, false, true, msgWindow);	 }	 else if(args.result == 3) { 	   return false;         }	 break;       case 1:         // download news, download mail, send unsent messages, go offline when done, msg window	 offlineManager.synchronizeForOffline(false, true, false, true, msgWindow);	 break;       case 2:         // download news, download mail, send unsent messages, go offline when done, msg window	 offlineManager.synchronizeForOffline(false, false, false, true, msgWindow);	 break;       }   }}
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/a5014eeb9603f1fcb5a28bfecb6ff6bcc4ee3e1e/commandglue.js/buggy/mailnews/base/resources/content/commandglue.js