Bug #145798 --> Create Filter from Message is not doable when message pane is closed.

Porting to thunderbird

patch by mcow
This commit is contained in:
scott%scott-macgregor.org 2004-03-15 19:41:14 +00:00
Родитель d38de0868d
Коммит dc68e1d0a6
2 изменённых файлов: 14 добавлений и 23 удалений

Просмотреть файл

@ -259,17 +259,14 @@ var DefaultController =
gDBView.getCommandStatus(nsMsgViewCommandType.toggleThreadWatched, enabled, checkStatus);
return enabled.value;
case "cmd_createFilterFromPopup":
case "cmd_createFilterFromMenu":
var loadedFolder = GetLoadedMsgFolder();
if (!(loadedFolder && loadedFolder.server.canHaveFilters))
return false;
case "cmd_createFilterFromMenu":
loadedFolder = GetLoadedMsgFolder();
if (!(loadedFolder && loadedFolder.server.canHaveFilters) || !(IsMessageDisplayedInMessagePane()))
return false;
return false; // else fall thru
case "cmd_saveAsFile":
case "cmd_saveAsTemplate":
if ( GetNumSelectedMessages() > 1)
return false;
if (GetNumSelectedMessages() > 1)
return false; // else fall thru
case "cmd_reply":
case "button_reply":
case "cmd_replySender":
@ -286,12 +283,12 @@ var DefaultController =
case "cmd_print":
case "cmd_viewPageSource":
case "cmd_reload":
if ( GetNumSelectedMessages() > 0)
if (GetNumSelectedMessages() > 0)
{
if (gDBView)
{
gDBView.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody, enabled, checkStatus);
return enabled.value;
gDBView.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody, enabled, checkStatus);
return enabled.value;
}
}
return false;

Просмотреть файл

@ -1004,22 +1004,16 @@ function MsgEditMessageAsNew()
function MsgCreateFilter()
{
var emailAddressNode;
// retrieve Sender direct from selected message's headers
var msgHdr = gDBView.hdrForFirstSelectedMessage;
var headerParser = Components.classes["@mozilla.org/messenger/headerparser;1"].getService(Components.interfaces.nsIMsgHeaderParser);
var emailAddress = headerParser.extractHeaderAddressMailboxes(null, msgHdr.author);
if (gCollapsedHeaderViewMode)
emailAddressNode = document.getElementById("collapsedfromValue");
else
emailAddressNode = document.getElementById("expandedfromBox").emailAddressNode;
if (emailAddressNode)
{
var emailAddress = emailAddressNode.getTextAttribute("emailAddress");
if (emailAddress){
top.MsgFilters(emailAddress);
}
}
if (emailAddress)
top.MsgFilters(emailAddress);
}
function MsgHome(url)
{
window.open(url, "_blank", "chrome,dependent=yes,all");