   folder = hdr.folder; 
function ComposeMessage(type, format, folder, messageArray){  var msgComposeType = Components.interfaces.nsIMsgCompType;  var identity = null;  var newsgroup = null;  var server;  // dump("ComposeMessage folder=" + folder + "\n");  try  {    if (folder)    {      // Get the incoming server associated with this uri.      server = folder.server;      // If they hit new or reply and they are reading a newsgroup,      // turn this into a new post or a reply to group.      if (!folder.isServer && server.type == "nntp" && type == msgComposeType.New)      {        type = msgComposeType.NewsPost;        newsgroup = folder.folderURL;      }      identity = folder.customIdentity;      if (!identity)        identity = getIdentityForServer(server);      // dump("identity = " + identity + "\n");    }  }  catch (ex)  {    dump("failed to get an identity to pre-select: " + ex + "\n");  }  // dump("\nComposeMessage from XUL: " + identity + "\n");  var uri = null;  if (!msgComposeService)  {    dump("### msgComposeService is invalid\n");    return;  }  if (type == msgComposeType.New)  {    // New message.    // dump("OpenComposeWindow with " + identity + "\n");    // If the addressbook sidebar panel is open and has focus, get    // the selected addresses from it.    if (document.commandDispatcher.focusedWindow.document.documentElement.hasAttribute("selectedaddresses"))      NewMessageToSelectedAddresses(type, format, identity);    else      msgComposeService.OpenComposeWindow(null, null, type, format, identity, msgWindow);    return;  }  else if (type == msgComposeType.NewsPost)  {    // dump("OpenComposeWindow with " + identity + " and " + newsgroup + "\n");    msgComposeService.OpenComposeWindow(null, newsgroup, type, format, identity, msgWindow);    return;  }  messenger.SetWindow(window, msgWindow);  var object = null;  if (messageArray && messageArray.length > 0)  {    uri = "";    for (var i = 0; i < messageArray.length; ++i)    {      var messageUri = messageArray[i];      var hdr = messenger.msgHdrFromURI(messageUri);      // If we treat reply from sent specially, do we check for that folder flag here ?      var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList;      var customIdentity = null;      if (folder)      {        server = folder.server;        customIdentity = folder.customIdentity;      }            var accountKey = hdr.accountKey;      if (accountKey.length > 0)      {        var account = accountManager.getAccount(accountKey);        if (account)          server = account.incomingServer;      }      identity = (server && !customIdentity)         ? getIdentityForServer(server, hintForIdentity)        : customIdentity;                               var messageID = hdr.messageId;      var messageIDScheme = messageID ? messageID.split(":")[0] : "";      if (messageIDScheme && (messageIDScheme == 'http' || messageIDScheme == 'https') &&  "openComposeWindowForRSSArticle" in this)        openComposeWindowForRSSArticle(messageID, hdr, type);      else if (type == msgComposeType.Reply ||               type == msgComposeType.ReplyAll ||               type == msgComposeType.ReplyToList ||               type == msgComposeType.ForwardInline ||               type == msgComposeType.ReplyToGroup ||               type == msgComposeType.ReplyToSender ||               type == msgComposeType.ReplyToSenderAndGroup ||               type == msgComposeType.Template ||               type == msgComposeType.Draft)      {        msgComposeService.OpenComposeWindow(null, messageUri, type, format, identity, msgWindow);        // Limit the number of new compose windows to 8. Why 8 ? I like that number :-)        if (i == 7)          break;      }      else      {        if (i)          uri += ","        uri += messageUri;      }    }    if (type == msgComposeType.ForwardAsAttachment && uri)      msgComposeService.OpenComposeWindow(null, uri, type, format, identity, msgWindow);  }  else    dump("### nodeList is invalid\n");}
5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5459/d86fcb2366780d27de71afd3d090de8b552dc21c/mailCommands.js/buggy/mail/base/content/mailCommands.js