rem: if (type == msgComposeType.New) {  
add: if (type == msgComposeType.New) {  
context: 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 = 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.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);      var hintForIdentity = (type == msgComposeType.Template) ? hdr.author : hdr.recipients + hdr.ccList;      var accountKey = hdr.accountKey;      if (accountKey.length > 0)      {        var account = accountManager.getAccount(accountKey);        if (account)          server = account.incomingServer;      }      if (server)        identity = getIdentityForServer(server, hintForIdentity);      var messageID = hdr.messageId;      var messageIDScheme = messageID.split(":")[0];      if ((messageIDScheme == 'http' || messageIDScheme == 'https') &&  "openComposeWindowForRSSArticle" in this)         openComposeWindowForRSSArticle(messageID, hdr, type);       else	if (type == msgComposeType.Reply || type == msgComposeType.ReplyAll || 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");}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/71c092caacd386bee09310aa330e599a601020d5/mailCommands.js/buggy/mail/base/content/mailCommands.js