[Thunderbird] Retreive hidden accounts

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

[Thunderbird] Retreive hidden accounts

Post by metju312 »

Hi,

I already hide accounts using this code:

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);
        account.incomingServer.hidden = true;
    }
Cause i need to have only one account on left panel.
And that work perfectly.

But..

I thought if i do:

Code: Select all

account.incomingServer.hidden = false;
my accounts will retreive - that's not happend - accouns is empty.

Question: How to retreive those accounts?

Here is some answer but i dont know how use that:
https://dxr.mozilla.org/comm-central/so ... Server.idl

Code: Select all

  /**
   * Hide this server/account from the UI - used for smart mailboxes.
   * The server can be retrieved from the account manager by name using the
   * various Find methods, but nsIMsgAccountManager's GetAccounts and 
   * GetAllServers methods won't return the server/account.
   */
  attribute boolean hidden;
Thanks for help.
metju312
Posts: 10
Joined: September 6th, 2017, 1:25 am

Re: [Thunderbird] Retreive hidden accounts

Post by metju312 »

I already resolve this (for: dev@gmail.com):

acctMgr.FindServer('dev', 'gmail.com', 'pop3').hidden = false;
Post Reply