rem: var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id'); dump("selectedFolder uri = " + uri + "\n"); 
add: var identity = null;  try { var folderTree = GetFolderTree(); var selectedFolderList = folderTree.selectedItems; if(selectedFolderList.length > 0) { var selectedFolder = selectedFolderList[0]; var uri = selectedFolder.getAttribute('id');    var server = accountManager.FindServerUsingURI(uri);   var identities = accountManager.GetIdentitiesForServer(server);   if (identities.Count() > 0 ) { identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); } }  } catch (ex) {  
context: function ComposeMessage(type, format)//type: 0=new message, 1=reply, 2=reply all,//      3=forward inline, 4=forward as attachment////format: 0=default (use preference), 1=HTML, 2=plain text{	var folderTree = GetFolderTree();        var selectedFolderList = folderTree.selectedItems;        if(selectedFolderList.length > 0)        {                var selectedFolder = selectedFolderList[0]; 		var uri = selectedFolder.getAttribute('id');		dump("selectedFolder uri = " + uri + "\n");	}	dump("\nComposeMessage from XUL\n");	var uri = null;	if (! msgComposeService)	{		dump("### msgComposeService is invalid\n");		return;	}		if (type == 0) //new message	{		msgComposeService.OpenComposeWindow(null, null, 0, format, null, null);		return;	}			var tree = GetThreadTree();	if (tree)	{		var nodeList = tree.selectedItems;		var appCore = FindMessenger();		if (appCore)			appCore.SetWindow(window, statusFeedback);					var object = null;			if (nodeList && nodeList.length > 0)		{			uri = "";			for (var i = 0; i < nodeList.length && i < 8; i ++)			{					dump('i = '+ i);				dump('\n');								if (type == 1 || type == 2) //reply or reply all				{					if (appCore)						object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary					msgComposeService.OpenComposeWindow(null, nodeList[i].getAttribute('id'), type, format, object, null);				}				else				{					if (i) 						uri += " "					uri += nodeList[i].getAttribute('id');				}			}						if (type == 3 || type == 4) //forward			{				if (appCore)					object = appCore.GetRDFResourceForMessage(tree, nodeList); //temporary				msgComposeService.OpenComposeWindow(null, uri, type, format, object, null);			}		}		else			dump("### nodeList is invalid\n");	}	else		dump("### tree is invalid\n");}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/a67ae1e68371db2678437a1b60112d25e4701467/commandglue.js/buggy/mailnews/base/resources/content/commandglue.js