MozillaZine

Thunderbird: Hide folderTree folders

Talk about add-ons and extension development.
metju312
 
Posts: 10
Joined: September 6th, 2017, 1:25 am

Post Posted September 6th, 2017, 1:36 am

Hi,

What i need:
I need to hide some folders in folderTree (left side of thunderbird).

Now:
1. I login (my own dialog) at mail account, for example: dev1@gmail.com
2. And i see all folders: for example 3 account folders: dev1@gmail.com, dev2@gmail.com, admin@gmail.com

I want to:
1. After login at dev1@gmail.com i need to see only dev1@gmail.com folder - hide rest folders - How to do that?

I already know:
nsIWindowMediator, gFolderTreeView
in order to: http://forums.mozillazine.org/viewtopic.php?f=39&t=3001721

Probably i need to hide account/server - not folders:
https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Account_examples

Code: Select all
var acctMgr = Cc["@mozilla.org/messenger/account-manager;1"].getService(Ci.nsIMsgAccountManager);
    var accounts = acctMgr.accounts;
    for (var i = 0; i < accounts.length; i++) {
        var account = accounts.queryElementAt(i, Ci.nsIMsgAccount);
        var rootFolder = account.incomingServer.rootFolder; // nsIMsgFolder
        console.log(rootFolder.prettiestName); // <<<< This log me all folders i need to hide
    }


Thanks for help

metju312
 
Posts: 10
Joined: September 6th, 2017, 1:25 am

Post Posted September 6th, 2017, 3:17 am

I already solve this: :D

account.incomingServer.hidden = true;

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 3 guests