rem: if (gCurrentMessageUri) { SetUpToolbarButtons(gCurrentMessageUri); } else if (gCurrentFolderUri) { SetUpToolbarButtons(gCurrentFolderUri); } 
add: var uri; if (gCurrentMessageUri) uri = gCurrentMessageUri; else if (gCurrentFolderUri) uri = gCurrentFolderUri; else uri = null;  SetUpToolbarButtons(uri);   var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.notifyObservers(window, "mail:setupToolbarItems", uri); 
context: function CreateView(originalView){    var msgFolder = GetLoadedMsgFolder();  // extract the sort type, the sort order,   var sortType;  var sortOrder;  var viewFlags;  var viewType;  if (originalView)  {    viewType = originalView.viewType;    viewFlags = originalView.viewFlags;    sortType = originalView.sortType;    sortOrder = originalView.sortOrder;  }  else if (msgFolder)  {    var msgDatabase = msgFolder.getMsgDatabase(msgWindow);    if (msgDatabase)    {      var dbFolderInfo = msgDatabase.dBFolderInfo;      sortType = dbFolderInfo.sortType;      sortOrder = dbFolderInfo.sortOrder;      viewFlags = dbFolderInfo.viewFlags;      viewType = dbFolderInfo.viewType;      msgDatabase = null;      dbFolderInfo = null;   }  }  // create a db view  CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType, sortOrder);   if (gCurrentMessageUri) {    SetUpToolbarButtons(gCurrentMessageUri);  }  else if (gCurrentFolderUri) {    SetUpToolbarButtons(gCurrentFolderUri);  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/8534f3b7e1882bf8d577791dee102218abe54483/messageWindow.js/buggy/mailnews/base/resources/content/messageWindow.js