rem: var folder = GetLoadedMsgFolder(); var moveJunkMail = (folder && folder.server && folder.server.spamSettings) ? folder.server.spamSettings.manualMark : false; 
add: var loadedFolder = GetLoadedMsgFolder(); var moveJunkMail = (loadedFolder && loadedFolder.server && loadedFolder.server.spamSettings) ? loadedFolder.server.spamSettings.manualMark : false; 
context: function HandleJunkStatusChanged(folder){  // this might be the stand alone window, open to a message that was  // and attachment (or on disk), in which case, we want to ignore it.  var loadedMessage = GetLoadedMessage();  if (loadedMessage && (!(/type=application\/x-message-display/.test(loadedMessage))) && IsCurrentLoadedFolder(folder))  {    // if multiple message are selected    // and we change the junk status    // we don't want to show the junk bar    // (since the message pane is blank)    if (GetNumSelectedMessages() == 1)    {      var msgHdr = messenger.messageServiceFromURI(loadedMessage).messageURIToMsgHdr(loadedMessage);      if (msgHdr)      {        // HandleJunkStatusChanged is a folder wide event and does not necessarily mean        // that the junk status on our currently selected message has changed.        // We have no way of determining if the junk status of our current message has really changed        // the only thing we can do is cheat by asking if the junkbar visibility had to change as a result of this notification        var changedJunkStatus = gMessageNotificationBar.setJunkMsg(msgHdr);        // we may be forcing junk mail to be rendered with sanitized html. In that scenario, we want to         // reload the message if the status has just changed to not junk.         var sanitizeJunkMail = gPrefBranch.getBoolPref("mailnews.display.sanitizeJunkMail");        if (changedJunkStatus && sanitizeJunkMail) // only bother doing this if we are modifying the html for junk mail....        {          var folder = GetLoadedMsgFolder();          var moveJunkMail = (folder && folder.server && folder.server.spamSettings) ? folder.server.spamSettings.manualMark : false;          var junkScore = msgHdr.getStringProperty("junkscore");           var isJunk = ((junkScore != "") && (junkScore != "0"));          // we used to only reload the message if we were toggling the message to NOT JUNK from junk          // but it can be useful to see the HTML in the message get converted to sanitized form when a message          // is marked as junk.          // Furthermore, if we are about to move the message that was just marked as junk,           // then don't bother reloading it.          if (!(isJunk && moveJunkMail))           MsgReload();        }      }    }    else      gMessageNotificationBar.setJunkMsg(null);  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/38c14e663ef1d0e4643ebcd8efbabb2cb62e4ce0/mailWindowOverlay.js/buggy/mail/base/content/mailWindowOverlay.js