Bug 660882 - search window does not allow to open message from result list [currentHeaderData is not defined]. r=Mnyromyr sr=Neil a=Callek CLOSED TREE
authorJens Hatlak <jh@junetz.de>
Wed, 08 Jun 2011 07:37:45 +0200
changeset 7806 e82715ab3680667e95edc8790c355393356ce499
parent 7805 1bde52433d6c0414f5e85d91f66b36fba898db2c
child 7807 0c7f86ea92f73ec8ce78149f402b4f20889c8814
push id12
push userjh@junetz.de
push dateWed, 08 Jun 2011 17:53:55 +0000
treeherdercomm-beta@e82715ab3680 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMnyromyr, Neil, Callek
bugs660882
Bug 660882 - search window does not allow to open message from result list [currentHeaderData is not defined]. r=Mnyromyr sr=Neil a=Callek CLOSED TREE
suite/mailnews/mailWindowOverlay.js
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -207,17 +207,17 @@ function view_init()
   if (view_menuitem)
     view_menuitem.setAttribute("disabled", gAccountCentralLoaded);
 
   var threads_menuitem = document.getElementById("viewMessagesMenu");
   if (threads_menuitem)
     threads_menuitem.setAttribute("disabled", gAccountCentralLoaded);
 
   // Initialize the Message Body menuitem
-  var isFeed = IsFeedItem();
+  var isFeed = gFolderDisplay.selectedMessageIsFeed;
   document.getElementById('viewBodyMenu').hidden = isFeed;
 
   // Initialize the Show Feed Summary menu
   var viewFeedSummary = document.getElementById('viewFeedSummary');
   var winType = document.documentElement.getAttribute('windowtype');
   if (winType != "mail:3pane")
     viewFeedSummary.hidden = !gShowFeedSummary;
   else
@@ -327,21 +327,18 @@ function InitViewMessagesMenu()
   var ignoredTheadsMenuItem = document.getElementById("viewIgnoredThreadsMenuItem");
   if (ignoredTheadsMenuItem)
     ignoredTheadsMenuItem.setAttribute("checked", (viewFlags & nsMsgViewFlagsType.kShowIgnored) != 0);
 }
 
 function InitMessageMenu()
 {
   var aMessage = GetFirstSelectedMessage();
-  var isNews = false;
-  if(aMessage) {
-      isNews = IsNewsMessage(aMessage);
-  }
-  var isFeed = IsFeedItem();
+  var isNews = gFolderDisplay.selectedMessageIsNews;
+  var isFeed = gFolderDisplay.selectedMessageIsFeed;
 
   // We show Reply to Newsgroups only for news messages.
   var replyNewsgroupMenuItem = document.getElementById("replyNewsgroupMainMenu");
   if(replyNewsgroupMenuItem)
   {
       replyNewsgroupMenuItem.setAttribute("hidden", isNews ? "" : "true");
   }
 
@@ -468,17 +465,17 @@ function InitViewHeadersMenu()
     menuitem.setAttribute("checked", "true"); 
 }
 
 function InitViewBodyMenu()
 {
   var html_as = 0;
   var prefer_plaintext = false;
   var disallow_classes = 0;
-  var isFeed = IsFeedItem();
+  var isFeed = gFolderDisplay.selectedMessageIsFeed;
   const defaultIDs = ["bodyAllowHTML",
                       "bodySanitized",
                       "bodyAsPlaintext"];
   const rssIDs = ["bodyFeedSummaryAllowHTML",
                   "bodyFeedSummarySanitized",
                   "bodyFeedSummaryAsPlaintext"];
   var menuIDs = isFeed ? rssIDs : defaultIDs;
   try
@@ -533,24 +530,16 @@ function IsNewsMessage(messageUri)
   return (/^news-message:/.test(messageUri));
 }
 
 function IsImapMessage(messageUri)
 {
   return (/^imap-message:/.test(messageUri));
 }
 
-function IsFeedItem()
-{
-  return (GetFirstSelectedMessage() &&
-          ((gMsgFolderSelected &&
-            gMsgFolderSelected.server.type == 'rss') ||
-           'content-base' in currentHeaderData));
-}
-
 function SetMenuItemLabel(menuItemId, customLabel)
 {
   var menuItem = document.getElementById(menuItemId);
   if (menuItem)
     menuItem.setAttribute('label', customLabel);
 }
 
 function RemoveAllMessageTags()
@@ -1690,17 +1679,18 @@ function MsgOpenNewWindowForFolder(uri, 
      mailWindowService.openMessengerWindowWithUri("mail:3pane", uriToOpen, keyToSelect);
   }
 }
 
 function MsgOpenSelectedMessages()
 {
   // Toggle message body (rss summary) and content-base url in message
   // pane per pref, otherwise open summary or web page in new window.
-  if (IsFeedItem() && GetFeedOpenHandler() == 2) {
+  if (gFolderDisplay.selectedMessageIsFeed && GetFeedOpenHandler() == 2)
+  {
     FeedSetContentViewToggle();
     return;
   }
 
   var dbView = GetDBView();
   var indices = GetSelectedIndices(dbView);
   var numMessages = indices.length;
 
@@ -3093,17 +3083,17 @@ function FeedSetContentViewToggle()
 }
 
 // Check message format
 function FeedCheckContentFormat()
 {
   var contentWindowDoc = window.top.content.document;
 
   // Not an rss message
-  if (!IsFeedItem())
+  if (!gFolderDisplay.selectedMessageIsFeed)
     return false;
 
   // Thunderbird 2 rss messages with 'Show article summary' not selected,
   // ie message body constructed to show web page in an iframe, can't show
   // a summary - notify user.
   var rssIframe = contentWindowDoc.getElementById('_mailrssiframe');
   if (rssIframe) {
     if (gShowFeedSummaryToggle || pref.getIntPref("rss.show.summary") == 1)