Bug 1563920 - fixed defining filters for news server. r=aceman a=jorgk BETA_68_CONTINUATION
authorKhushil Mistry <khushil324@gmail.com>
Tue, 09 Jul 2019 02:26:00 +0200
branchBETA_68_CONTINUATION
changeset 36069 45da8935d5bea2df0383a744904028588819dc51
parent 36068 96624d62b756ba7ecd2df24958fad0caf13a85f4
child 36070 feabcfb77b987338e3a28a8b7d6440ff9e0e2e23
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersaceman, jorgk
bugs1563920
Bug 1563920 - fixed defining filters for news server. r=aceman a=jorgk
mail/test/mozmill/folder-widget/test-message-filters.js
mailnews/base/content/folder-menupopup.js
--- a/mail/test/mozmill/folder-widget/test-message-filters.js
+++ b/mail/test/mozmill/folder-widget/test-message-filters.js
@@ -69,17 +69,17 @@ function test_message_filter_shows_newsg
   // filterc.select(popup, 2);
   // let nntpPopup = new elib.Elem(nntp.node.menupopup);
   // filterc.click(nntpPopup);
   // filterc.mouseover(nntpPopup);
   // filterc.select(nntpPopup, 2);
 
   // This one initializes the menuitems, but it's kinda hacky.
   nntp.node.menupopup._ensureInitialized();
-  assert_equals(nntp.node.itemCount, 3,
+  assert_equals(nntp.node.itemCount, 5,
                 "Incorrect number of children for the NNTP server");
   close_window(filterc);
 }
 
 /*
  * Test that customizing the toolbar doesn't lead to doubled accounts in
  * the Get Mail menu.  (bug 520457)
  */
--- a/mailnews/base/content/folder-menupopup.js
+++ b/mailnews/base/content/folder-menupopup.js
@@ -601,17 +601,16 @@
      *  folder instead.
      *
      * @param {string} mode  The mode attribute.
      */
     _maybeAddParentFolderMenuItem(mode) {
       let folder = this._parentFolder;
       if (folder && (this.getAttribute("showFileHereLabel") == "true" || !mode)) {
         let showAccountsFileHere = this.getAttribute("showAccountsFileHere");
-
         if ((!folder.isServer || showAccountsFileHere != "false") &&
              (!mode || mode == "newFolder" || folder.noSelect ||
                folder.canFileMessages || showAccountsFileHere == "true")) {
           let attributes = {};
 
           if (this.hasAttribute("fileHereLabel")) {
             attributes.label = this.getAttribute("fileHereLabel");
             attributes.accesskey = this.getAttribute("fileHereAccessKey");
@@ -671,17 +670,18 @@
           // xxx this is slightly problematic in that we haven't confirmed
           //     whether any of the subfolders will pass the filter.
 
           this._serversOnly = false;
 
           let submenuAttributes = {};
 
           ["class", "type", "fileHereLabel", "showFileHereLabel", "oncommand",
-            "mode", "disableServers", "position"].forEach(attribute => {
+            "showAccountsFileHere", "mode", "disableServers", "position"]
+            .forEach(attribute => {
             if (this.hasAttribute(attribute)) {
               submenuAttributes[attribute] = this.getAttribute(attribute);
             }
           });
 
           const [menuItem, submenu] = this._buildMenuItemWithSubmenu(attributes,
             true, folder, submenuAttributes);