31438: stealth msg compose (r=ducarroz)

This commit is contained in:
akkana%netscape.com 2000-03-14 02:59:13 +00:00
parent 8f13e2f0b2
commit 1e8b1a7614
3 changed files with 29 additions and 5 deletions

View File

@ -450,18 +450,27 @@ function MsgDeleteFolder()
function MsgNewMessage(event)
{
if (event.shiftKey)
ComposeMessage(msgComposeType.New, msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.New, msgComposeFormat.Default);
}
function MsgReplyMessage(event)
{
dump("\nMsgReplyMessage from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.Reply, msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.Reply, msgComposeFormat.Default);
}
function MsgReplyToAllMessage(event)
{
dump("\nMsgReplyToAllMessage from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.ReplyAll, msgComposeFormat.Default);
}
@ -482,12 +491,20 @@ function MsgForwardMessage(event)
function MsgForwardAsAttachment(event)
{
dump("\nMsgForwardAsAttachment from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ForwardAsAttachment,
msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.ForwardAsAttachment, msgComposeFormat.Default);
}
function MsgForwardAsInline(event)
{
dump("\nMsgForwardAsInline from XUL\n");
if (event.shiftKey)
ComposeMessage(msgComposeType.ForwardInline,
msgComposeFormat.OppositeOfDefault);
else
ComposeMessage(msgComposeType.ForwardInline, msgComposeFormat.Default);
}

View File

@ -55,6 +55,7 @@ interface nsIMsgCompFormat {
const long Default = 0;
const long HTML = 1;
const long PlainText = 2;
const long OppositeOfDefault = 3;
};
typedef long MSG_ComposeSaveType;

View File

@ -400,6 +400,12 @@ nsresult nsMsgCompose::Initialize(nsIDOMWindow *aWindow,
{
case nsIMsgCompFormat::HTML : m_composeHTML = PR_TRUE; break;
case nsIMsgCompFormat::PlainText : m_composeHTML = PR_FALSE; break;
case nsIMsgCompFormat::OppositeOfDefault:
/* ask the identity which compose to use */
if (m_identity) m_identity->GetComposeHtml(&m_composeHTML);
/* then use the opposite */
m_composeHTML = !m_composeHTML;
break;
default :
/* ask the identity which compose to use */
if (m_identity) m_identity->GetComposeHtml(&m_composeHTML);