fix for #8219. only honor delete of a news message (cancel) when from the menu.

This commit is contained in:
sspitzer%netscape.com 1999-07-23 09:18:13 +00:00
parent 54762c7045
commit ea91269dfa
2 changed files with 20 additions and 8 deletions

View File

@ -301,7 +301,7 @@ Rights Reserved.
<menuitem name="&cutCmd.label;" onclick="MsgEditCut();"/>
<menuitem name="&copyCmd.label;" onclick="MsgEditCopy();"/>
<menuitem name="&pasteCmd.label;" onclick="MsgEditPaste();"/>
<menuitem name="&deleteMsgCmd.label;" onclick="MsgDeleteMessage();"/>
<menuitem name="&deleteMsgCmd.label;" onclick="MsgDeleteMessage(false);"/>
<menuitem name="&deleteFolderCmd.label;" onclick="MsgDeleteFolder();"/>
<menu name="&selectMenu.label;">
<menuitem name="&selectAllCmd.label;" onclick="MsgSelectAll();"/>
@ -510,7 +510,7 @@ Rights Reserved.
<titledbutton src="&newMsgButton.img;" align="bottom" value="&newMsgButton.label;" onclick="MsgNewMessage()"/>
<titledbutton src="&replyButton.img;" align="bottom" value="&replyButton.label;" onclick="MsgReplyMessage()"/>
<titledbutton src="&forwardButton.img;" align="bottom" value="&forwardButton.label;" onclick="MsgForwardMessage()"/>
<titledbutton src="&deleteButton.img;" align="bottom" value="&deleteButton.label;" onclick="MsgDeleteMessage()"/>
<titledbutton src="&deleteButton.img;" align="bottom" value="&deleteButton.label;" onclick="MsgDeleteMessage(true)"/>
<spring flex="100%"/>
<titledbutton src="&throbber.img;" align="right" onclick="MsgHome('&throbber.url;')"/>

View File

@ -56,17 +56,29 @@ function MsgGetMessage()
GetNewMessages();
}
function MsgDeleteMessage()
function MsgDeleteMessage(fromToolbar)
{
dump("\nMsgDeleteMessage from XUL\n");
//dump("from toolbar? " + fromToolbar + "\n");
var tree = GetThreadTree();
if(tree) {
dump("tree is valid\n");
//get the selected elements
var messageList = tree.getElementsByAttribute("selected", "true");
//get the current folder
var srcFolder = GetThreadTreeFolder();
messenger.DeleteMessages(tree, srcFolder, messageList);
// if from the toolbar, return right away if this is a news message
// only allow cancel from the menu: "Edit | Cancel / Delete Message"
if (fromToolbar) {
uri = srcFolder.getAttribute('id');
//dump("uri[0:6]=" + uri.substring(0,6) + "\n");
if (uri.substring(0,6) == "news:/") {
//dump("delete ignored!\n");
return;
}
}
dump("tree is valid\n");
//get the selected elements
var messageList = tree.getElementsByAttribute("selected", "true");
//get the current folder
messenger.DeleteMessages(tree, srcFolder, messageList);
}
}