MozillaZine

[Thunderbird] Retreive hidden accounts

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

Post Posted September 11th, 2017, 9:10 am

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/source/mailnews/base/public/nsIMsgIncomingServer.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

Post Posted September 12th, 2017, 4:24 am

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

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

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests

cron