rem:  var promptText = Bundle.formatStringFromName("advanceNextPrompt", [ nextFolder.name ], 1); if (commonDialogs.Confirm(window, promptText, promptText)) { 
add:  switch (nextMode) {  case 0:  gNextMessageAfterLoad = true; SelectFolder(nextFolderURI); break;  case 1: var promptText = Bundle.formatStringFromName("advanceNextPrompt", [ nextFolder.name ], 1); if (commonDialogs.Confirm(window, promptText, promptText)) { 
context: function GoNextMessage(type, startFromBeginning ){	var beforeGoNextMessage;    if (showPerformance) {	    beforeGoNextMessage = new Date();    }	var tree = GetThreadTree();		var selArray = tree.selectedItems;	var length = selArray.length;	if ( selArray && ((length == 0) || (length == 1)) )	{		var currentMessage;		if(length == 0)			currentMessage = null;		else			currentMessage = selArray[0];		var nextMessage = msgNavigationService.FindNextMessage(type, tree, currentMessage, RDF, document, startFromBeginning, messageView.showThreads);		//Only change the selection if there's a valid nextMessage		if(nextMessage && (nextMessage != currentMessage)) {			ChangeSelection(tree, nextMessage);        }        else if (type == navigateUnread) {	        var treeFolder = GetThreadTreeFolder();	        var originalFolderURI = treeFolder.getAttribute('ref');            var nextFolderURI = null;            var done = false;            var startAtURI = originalFolderURI;            var i = 0;            var allServers = accountManager.allServers;            var numServers = allServers.Count();            // todo:              // this will search the originalFolderURI server twice            // prevent that.            while (!done) {                dump("start looking at " + startAtURI + "\n");                nextFolderURI = FindNextFolder(startAtURI);                if (!nextFolderURI) {                    if (i == numServers) {                        // no more servers, we're done                        done = true;                    }                    else {                        // get the uri for the next server and start there                        startAtURI = allServers.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgIncomingServer).serverURI;                        i++;                    }                }                else {                    // got a folder with unread messages, start with it                    done = true;                    }            }            if (nextFolderURI && (originalFolderURI != nextFolderURI)) {                var nextFolderResource = RDF.GetResource(nextFolderURI);                var nextFolder = nextFolderResource.QueryInterface(Components.interfaces.nsIMsgFolder);                 var promptText = Bundle.formatStringFromName("advanceNextPrompt", [ nextFolder.name ], 1);                 if (commonDialogs.Confirm(window, promptText, promptText)) {                        gNextMessageAfterLoad = true;                        SelectFolder(nextFolderURI);                }            }        }	}    if (showPerformance) {	  var afterGoNextMessage = new Date();	  var timeToGetNext = (afterGoNextMessage.getTime() - beforeGoNextMessage.getTime())/1000;	  dump("time to GoNextMessage is " + timeToGetNext + "seconds\n");    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/e16ca2db26b960f4a6b620b3b51260fd8f302265/msgViewNavigation.js/clean/mailnews/base/resources/content/msgViewNavigation.js