add:  var sortTypeSupportsGrouping = (sortType == nsMsgViewSortType.byAuthor || sortType == nsMsgViewSortType.byDate || sortType == nsMsgViewSortType.byPriority || sortType == nsMsgViewSortType.bySubject || sortType == nsMsgViewSortType.byLabel || sortType == nsMsgViewSortType.byStatus  || sortType == nsMsgViewSortType.byRecipient);  if (!dbview.supportsThreading || !sortTypeSupportsGrouping) return; 
context: function MsgGroupBySort(){  var dbview = GetDBView();  var viewFlags = dbview.viewFlags;  var sortOrder = dbview.sortOrder;  var sortType = dbview.sortType;  var count = new Object;  var msgFolder = dbview.msgFolder;  viewFlags |= nsMsgViewFlagsType.kThreadedDisplay | nsMsgViewFlagsType.kGroupBySort;  // null this out, so we don't try sort.  if (gDBView) {    gDBView.close();    gDBView = null;  }  var dbviewContractId = "@mozilla.org/messenger/msgdbview;1?type=group";  gDBView = Components.classes[dbviewContractId].createInstance(Components.interfaces.nsIMsgDBView);  if (!gThreadPaneCommandUpdater)    gThreadPaneCommandUpdater = new nsMsgDBViewCommandUpdater();  gDBView.init(messenger, msgWindow, gThreadPaneCommandUpdater);  gDBView.open(msgFolder, sortType, sortOrder, viewFlags, count);  RerootThreadPane();  UpdateSortIndicators(sortType, nsMsgViewSortOrder.ascending);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/96e13dbf5bdbbbb0842184f733c94f5b0cd07e0e/threadPane.js/clean/mailnews/base/resources/content/threadPane.js