rem: var folderURI = GetSelectedFolderURI(); var server = GetServer(folderURI); if (!(server && server.canCompactFoldersOnServer)) return false;  var folderTree = GetFolderTree(); var startIndex = {}; var endIndex = {}; folderTree.treeBoxObject.selection.getRangeAt(0, startIndex, endIndex); if (startIndex.value < 0) return false;  var folderResource = GetFolderResource(folderTree, startIndex.value); if (! folderResource) return false;  return GetFolderAttribute(folderTree, folderResource, "CanCompact") == "true" && isCommandEnabled("cmd_compactFolder"); 
add: var server = GetServer(GetSelectedFolderURI()); return (server && ((server.type != 'imap') || server.canCompactFoldersOnServer) && isCommandEnabled("cmd_compactFolder")); 
context: function IsCompactFolderEnabled(){  var folderURI = GetSelectedFolderURI();  var server = GetServer(folderURI);  if (!(server && server.canCompactFoldersOnServer))    return false;  var folderTree = GetFolderTree();  var startIndex = {};  var endIndex = {};  folderTree.treeBoxObject.selection.getRangeAt(0, startIndex, endIndex);  if (startIndex.value < 0)        return false;  var folderResource = GetFolderResource(folderTree, startIndex.value);  if (! folderResource)        return false;  return GetFolderAttribute(folderTree, folderResource, "CanCompact") == "true" && isCommandEnabled("cmd_compactFolder");}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d38de0868db9cc2f0dea01472876fd2436059ca0/mailWindowOverlay.js/buggy/mail/base/content/mailWindowOverlay.js