MozillaZine

add subfolder in scratch pad doesnt show up in mailbox

Talk about add-ons and extension development.
nickhere
 
Posts: 40
Joined: September 29th, 2009, 1:57 pm

Post Posted November 28th, 2018, 5:41 pm

it does after i restart tbird

Code: Select all
var acctMgr = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
var accounts = acctMgr.accounts;
var account = accounts.queryElementAt(0, Components.interfaces.nsIMsgAccount);
console.log(account.incomingServer.prettyName + " " +  account.incomingServer.rootFolder.numSubFolders);
var enumerator = account.incomingServer.rootFolder.subFolders;
var folder = enumerator.getNext().QueryInterface(Components.interfaces.nsIMsgFolder);
folder.addSubfolder("test");  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,this line works  but dont show up
var enumerator1 = folder.messages;
      var headerParser = Components.classes["@mozilla.org/messenger/headerparser;1"].getService(Components.interfaces.nsIMsgHeaderParser);
       var msgHdr = enumerator1.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
       var from = msgHdr.mime2DecodedAuthor;
       var to = msgHdr.mime2DecodedRecipients;
       var date = new Date(msgHdr.dateInSeconds * 1000).toLocaleString();
       var fromName = headerParser.extractHeaderAddressName(from);
       var fromMailboxes = headerParser.extractHeaderAddressMailboxes(from);
     console.log(from + "," +  fromMailboxes);

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests