rem:  function MsgSearchMessages() { var preselectedFolder = null; if ("GetFirstSelectedMsgFolder" in window) preselectedFolder = GetFirstSelectedMsgFolder();  var args = { folder: preselectedFolder }; OpenOrFocusWindow(args, "mailnews:search", "chrome: }  function MsgJunkMail() { MsgJunkMailInfo(true); var preselectedFolder = null; if ("GetFirstSelectedMsgFolder" in window) preselectedFolder = GetFirstSelectedMsgFolder();  var args = { folder: preselectedFolder }; OpenOrFocusWindow(args, "mailnews:junk", "chrome: }  function MsgJunkMailInfo(aCheckFirstUse) { if (aCheckFirstUse) { if (!pref.getBoolPref("mailnews.ui.junk.firstuse")) return; pref.setBoolPref("mailnews.ui.junk.firstuse", false);    var junkmailPlugin = Components.classes["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"] .getService(Components.interfaces.nsIJunkMailPlugin); if (junkmailPlugin.userHasClassified) return; }  var desiredWindow = GetWindowByWindowType("mailnews:junkmailinfo");  if (desiredWindow) desiredWindow.focus(); else window.openDialog("chrome: }  function MsgSearchAddresses() { var args = { directory: null }; OpenOrFocusWindow(args, "mailnews:absearch", "chrome: }  function MsgFilterList(args) { OpenOrFocusWindow(args, "mailnews:filterlist", "chrome: }  function GetWindowByWindowType(windowType) { var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator); return windowManager.getMostRecentWindow(windowType); }  function OpenOrFocusWindow(args, windowType, chromeURL) { var desiredWindow = GetWindowByWindowType(windowType);  if (desiredWindow) { desiredWindow.focus(); if ("refresh" in args && args.refresh) desiredWindow.refresh(); } else window.openDialog(chromeURL, "", "chrome,resizable,status,centerscreen,dialog=no", args); }   function loadThrobberUrl(urlPref) { var url; try { url = gPrefs.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data; messenger.launchExternalURL(url); } catch (ex) {} } 
context: function HandleMDNResponse(aUrl){  if (!aUrl)    return;  var msgFolder = aUrl.folder;  var msgURI = GetLoadedMessage();  if (!msgFolder || !msgURI)    return;	if (IsNewsMessage(msgURI))		return;  // if the message is marked as junk, do NOT attempt to process a return receipt  // in order to better protect the user  if (SelectedMessagesAreJunk())    return;  var msgHdr = messenger.messageServiceFromURI(msgURI).messageURIToMsgHdr(msgURI);  var mimeHdr;    try   {    mimeHdr = aUrl.mimeHeaders;    }   catch (ex) { dump('i don't understand how this can happen. mailWindowOverlay.js, HandleMDNResponse\n'); return 0; }      // If we didn't get the message id when we downloaded the message header,  // we cons up an md5: message id. If we've done that, we'll try to extract  // the message id out of the mime headers for the whole message.  var msgId = msgHdr.messageId;  if (msgId.split(":")[0] == "md5")  {    var mimeMsgId = mimeHdr.extractHeader("Message-Id", false);    if (mimeMsgId)      msgHdr.messageId = mimeMsgId;  }    // After a msg is downloaded it's already marked READ at this point so we must check if  // the msg has a "Disposition-Notification-To" header and no MDN report has been sent yet.  var msgFlags = msgHdr.flags;  if ((msgFlags & MSG_FLAG_IMAP_DELETED) || (msgFlags & MSG_FLAG_MDN_REPORT_SENT))    return;  var DNTHeader = mimeHdr.extractHeader("Disposition-Notification-To", false);  if (!DNTHeader)    return;   // Everything looks good so far, let's generate the MDN response.  var mdnGenerator = Components.classes["@mozilla.org/messenger-mdn/generator;1"].                                  createInstance(Components.interfaces.nsIMsgMdnGenerator);  mdnGenerator.process(MDN_DISPOSE_TYPE_DISPLAYED, msgWindow, msgFolder, msgHdr.messageKey, mimeHdr, false);  // Reset mark msg MDN "Sent" and "Not Needed".  msgHdr.flags = (msgFlags & ~MSG_FLAG_MDN_REPORT_NEEDED);  msgHdr.OrFlags(MSG_FLAG_MDN_REPORT_SENT);  // Commit db changes.  var msgdb = msgFolder.getMsgDatabase(msgWindow);  if (msgdb)    msgdb.Commit(ADDR_DB_LARGE_COMMIT);}function MsgSearchMessages(){  var preselectedFolder = null;  if ("GetFirstSelectedMsgFolder" in window)    preselectedFolder = GetFirstSelectedMsgFolder();  var args = { folder: preselectedFolder };  OpenOrFocusWindow(args, "mailnews:search", "chrome://messenger/content/SearchDialog.xul");}function MsgJunkMail(){  MsgJunkMailInfo(true);  var preselectedFolder = null;  if ("GetFirstSelectedMsgFolder" in window)    preselectedFolder = GetFirstSelectedMsgFolder();  var args = { folder: preselectedFolder };  OpenOrFocusWindow(args, "mailnews:junk", "chrome://messenger/content/junkMail.xul");}function MsgJunkMailInfo(aCheckFirstUse){  if (aCheckFirstUse) {    if (!pref.getBoolPref("mailnews.ui.junk.firstuse"))      return;    pref.setBoolPref("mailnews.ui.junk.firstuse", false);    // check to see if this is an existing profile where the user has started using    // the junk mail feature already    var junkmailPlugin = Components.classes["@mozilla.org/messenger/filter-plugin;1?name=bayesianfilter"]                                   .getService(Components.interfaces.nsIJunkMailPlugin);    if (junkmailPlugin.userHasClassified)      return;  }  var desiredWindow = GetWindowByWindowType("mailnews:junkmailinfo");  if (desiredWindow)    desiredWindow.focus();  else    window.openDialog("chrome://messenger/content/junkMailInfo.xul", "mailnews:junkmailinfo", "centerscreen,resizeable=no,titlebar,chrome,modal", null);}function MsgSearchAddresses(){  var args = { directory: null };  OpenOrFocusWindow(args, "mailnews:absearch", "chrome://messenger/content/ABSearchDialog.xul");} function MsgFilterList(args){  OpenOrFocusWindow(args, "mailnews:filterlist", "chrome://messenger/content/FilterListDialog.xul");}function GetWindowByWindowType(windowType){  var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator);  return windowManager.getMostRecentWindow(windowType);}function OpenOrFocusWindow(args, windowType, chromeURL){  var desiredWindow = GetWindowByWindowType(windowType);  if (desiredWindow) {    desiredWindow.focus();    if ("refresh" in args && args.refresh)      desiredWindow.refresh();  }  else    window.openDialog(chromeURL, "", "chrome,resizable,status,centerscreen,dialog=no", args);}function loadThrobberUrl(urlPref){    var url;    try {        url = gPrefs.getComplexValue(urlPref, Components.interfaces.nsIPrefLocalizedString).data;        messenger.launchExternalURL(url);      } catch (ex) {}}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/1f3cdb7e881c6608d20cb7163fd1ad8e989e4e4a/mailWindowOverlay.js/clean/mail/base/content/mailWindowOverlay.js