Maybe name the method GetCurrentMsgServerType or something more descriptive?
> {
> let msgHdr = messenger.msgHdrFromURI(GetLoadedMessage());
>
>+ let serverType = null;
>+ try
>+ {
>+ serverType = msgHdr.folder.server.type;
>+ }
>+ catch (ex)
>+ {
>+ // This empty catch block needs to be here because msgHdr.folder will
>+ // throw an exception when you try to access it on a .eml file.
>+ }
>+ return serverType
>+}
>+
>+function isReplyEnabled()
>+{
>+ if (getServerType() == "rss")
>+ // If we're in an rss item, we never want to Reply, because there's
>+ // usually no-one useful to reply to.
>+ return false;
>+ return true;
>+}
(From update of attachment 382141)
This seems to work well, however I have a few nits.
Please capitalize the js method names like it's elsewhere in the file/s.
>diff --git a/mail/ base/content/ mail3PaneWindow Commands. js b/mail/ base/content/ mail3PaneWindow Commands. js base/content/ mail3PaneWindow Commands. js base/content/ mail3PaneWindow Commands. js command, whichText); command, whichText + "AccessKey");
>--- a/mail/
>+++ b/mail/
>@@ -323,15 +323,25 @@
> goSetMenuValue(
> goSetAccessKey(
> }
>+ let retval = false;
Mozilla code almost always use rv for that.
> if (GetNumSelected Messages( ) > 0) getCommandStatu s(nsMsgViewComm andType. cmdRequiringMsg Body, enabled, checkStatus); ed(); led();
> {
> if (gDBView)
> {
> gDBView.
>- return enabled.value;
>+ retval = enabled.value;
> }
> }
>- return false;
>+ if (retval)
>+ {
>+ if (command == "cmd_reply" || command == "button_reply")
>+ retval = isReplyEnabled();
>+ else if (command == "cmd_replyall" || command == "button_replyall")
>+ retval = isReplyAllEnabl
>+ else if (command == "cmd_replylist" || command == "button_replylist")
>+ retval = isReplyListEnab
>+ }
Why aren't these higher up directly after each "case foo:"?
>+ return retval; essages( ) == 1 && gDBView) base/content/ mailWindowOverl ay.js b/mail/ base/content/ mailWindowOverl ay.js base/content/ mailWindowOverl ay.js base/content/ mailWindowOverl ay.js selectedIndex = SelectedMessage sAreJunk( ) ? 1 : 0; ons()
> case "cmd_printpreview":
> if ( GetNumSelectedM
> {
>diff --git a/mail/
>--- a/mail/
>+++ b/mail/
>@@ -807,10 +807,45 @@
> junkButtonDeck.
> }
>
>-function UpdateReplyButt
>+function getServerType()
Maybe name the method GetCurrentMsgSe rverType or something more descriptive?
> { msgHdrFromURI( GetLoadedMessag e()); folder. server. type;
> let msgHdr = messenger.
>
>+ let serverType = null;
>+ try
>+ {
>+ serverType = msgHdr.
>+ }
>+ catch (ex)
>+ {
>+ // This empty catch block needs to be here because msgHdr.folder will
>+ // throw an exception when you try to access it on a .eml file.
>+ }
>+ return serverType
>+}
>+
>+function isReplyEnabled()
>+{
>+ if (getServerType() == "rss")
>+ // If we're in an rss item, we never want to Reply, because there's
>+ // usually no-one useful to reply to.
>+ return false;
>+ return true;
>+}
Could just be |return getServerType() != "rss";|