зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
d38de0868d
Коммит
dc68e1d0a6
|
@ -259,17 +259,14 @@ var DefaultController =
|
||||||
gDBView.getCommandStatus(nsMsgViewCommandType.toggleThreadWatched, enabled, checkStatus);
|
gDBView.getCommandStatus(nsMsgViewCommandType.toggleThreadWatched, enabled, checkStatus);
|
||||||
return enabled.value;
|
return enabled.value;
|
||||||
case "cmd_createFilterFromPopup":
|
case "cmd_createFilterFromPopup":
|
||||||
|
case "cmd_createFilterFromMenu":
|
||||||
var loadedFolder = GetLoadedMsgFolder();
|
var loadedFolder = GetLoadedMsgFolder();
|
||||||
if (!(loadedFolder && loadedFolder.server.canHaveFilters))
|
if (!(loadedFolder && loadedFolder.server.canHaveFilters))
|
||||||
return false;
|
return false; // else fall thru
|
||||||
case "cmd_createFilterFromMenu":
|
|
||||||
loadedFolder = GetLoadedMsgFolder();
|
|
||||||
if (!(loadedFolder && loadedFolder.server.canHaveFilters) || !(IsMessageDisplayedInMessagePane()))
|
|
||||||
return false;
|
|
||||||
case "cmd_saveAsFile":
|
case "cmd_saveAsFile":
|
||||||
case "cmd_saveAsTemplate":
|
case "cmd_saveAsTemplate":
|
||||||
if ( GetNumSelectedMessages() > 1)
|
if (GetNumSelectedMessages() > 1)
|
||||||
return false;
|
return false; // else fall thru
|
||||||
case "cmd_reply":
|
case "cmd_reply":
|
||||||
case "button_reply":
|
case "button_reply":
|
||||||
case "cmd_replySender":
|
case "cmd_replySender":
|
||||||
|
@ -286,12 +283,12 @@ var DefaultController =
|
||||||
case "cmd_print":
|
case "cmd_print":
|
||||||
case "cmd_viewPageSource":
|
case "cmd_viewPageSource":
|
||||||
case "cmd_reload":
|
case "cmd_reload":
|
||||||
if ( GetNumSelectedMessages() > 0)
|
if (GetNumSelectedMessages() > 0)
|
||||||
{
|
{
|
||||||
if (gDBView)
|
if (gDBView)
|
||||||
{
|
{
|
||||||
gDBView.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody, enabled, checkStatus);
|
gDBView.getCommandStatus(nsMsgViewCommandType.cmdRequiringMsgBody, enabled, checkStatus);
|
||||||
return enabled.value;
|
return enabled.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1004,22 +1004,16 @@ function MsgEditMessageAsNew()
|
||||||
|
|
||||||
function MsgCreateFilter()
|
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)
|
if (emailAddress)
|
||||||
emailAddressNode = document.getElementById("collapsedfromValue");
|
top.MsgFilters(emailAddress);
|
||||||
else
|
|
||||||
emailAddressNode = document.getElementById("expandedfromBox").emailAddressNode;
|
|
||||||
|
|
||||||
if (emailAddressNode)
|
|
||||||
{
|
|
||||||
var emailAddress = emailAddressNode.getTextAttribute("emailAddress");
|
|
||||||
if (emailAddress){
|
|
||||||
top.MsgFilters(emailAddress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function MsgHome(url)
|
function MsgHome(url)
|
||||||
{
|
{
|
||||||
window.open(url, "_blank", "chrome,dependent=yes,all");
|
window.open(url, "_blank", "chrome,dependent=yes,all");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче