Closed Bug 482477 Opened 17 years ago Closed 17 years ago

add a way to have a hidden account

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: Bienvenu, Assigned: Bienvenu)

References

Details

(Whiteboard: [b3ux][m4][has patch])

Attachments

(1 file, 1 obsolete file)

The code in bug 305340 for Smart Mailboxes folder pane mode requires a Smart Mailboxes account - but this account should be hidden from all other UI (e.g., the account manager, the move/copy menu items, etc). I'm thinking of adding a hidden attribute to nsIMsgAccount and making the code that lists accounts ignore the hidden ones, so that you have to find the hidden one(s) by name, which should cause minimal code perturbation (otherwise, I'd need to find all the places that list accounts and teach them to ignore hidden accounts).
Flags: blocking-thunderbird3+
Blocks: 305340
OS: Windows XP → All
Hardware: x86 → All
Attached patch proposed fix (obsolete) — — Splinter Review
I'm going to run with this a bit, but it seems to be working.
Attachment #367789 - Flags: superreview?(neil)
Attachment #367789 - Flags: review?(bugzilla)
Whiteboard: [b3ux][m4][has patch]
Comment on attachment 367789 [details] [diff] [review] proposed fix >+ // enumerate by going through the list of accounts, so that we >+ // get the order correct >+ m_incomingServers.Enumerate(hashGetNonHiddenServersToArray, >+ (void *)(nsISupportsArray*)servers); I guess the comment is wrong here, since the old code didn't do this ;-) >+ // get all servers, including hidden servers. >+ nsresult GetAllServersInternal(nsISupportsArray **_retval); Hmm... is it possible to convert the callers to use m_incomingServers?
Comment on attachment 367789 [details] [diff] [review] proposed fix In general looks reasonable, but I'd like to see a response to Neil's comments and/or updated patch before reviewing.
Attachment #367789 - Flags: review?(bugzilla)
I think Neil's comments are reasonable - I'll try to do a new patch today.
It turned out to be relatively easy to get rid of one of the uses of GetAllServersInternal but the other one (for saving virtualfolders.dat) was a bit ugly. I added a call to LoadAccounts to FindServerByURI because the send later stuff was trying to resolve the send later folder uri before the account manager seems to have loaded accounts - I'm not sure why I just ran into that, but it seems like the right thing to do.
Attachment #367789 - Attachment is obsolete: true
Attachment #370488 - Flags: superreview?(neil)
Attachment #370488 - Flags: review?(bugzilla)
Attachment #367789 - Flags: superreview?(neil)
Comment on attachment 370488 [details] [diff] [review] fix partially addressing Neil's comments >+ nsIOutputStream *outputStream = * (nsIOutputStream **) data; >+ if (!outputStream) > { >+ nsCOMPtr<nsILocalFile> file; >+ GetVirtualFoldersFile(file); >+ rv = NS_NewLocalFileOutputStream(&outputStream, >+ file, >+ PR_CREATE_FILE | PR_WRONLY | PR_TRUNCATE, >+ 0664); >+ NS_ENSURE_SUCCESS(rv, PL_DHASH_STOP); >+ * (nsIOutputStream **) data = outputStream; >+ WriteLineToOutputStream("version=", "1", outputStream); I assume this is better than nsIOutputStream* & or * *outputStream?
Attachment #370488 - Flags: superreview?(neil) → superreview+
Whiteboard: [b3ux][m4][has patch] → [b3ux][m4][has patch][needs review Standard8]
Comment on attachment 370488 [details] [diff] [review] fix partially addressing Neil's comments >diff --git a/mailnews/base/public/nsIMsgAccountManager.idl b/mailnews/base/public/nsIMsgAccountManager.idl >--- a/mailnews/base/public/nsIMsgAccountManager.idl >+++ b/mailnews/base/public/nsIMsgAccountManager.idl >@@ -102,27 +102,28 @@ interface nsIMsgAccountManager : nsISupp > /* account list stuff */ > > /* defaultAccount should always be set if there are any accounts > * in the account manager. You can only set the defaultAccount to an > * account already in the account manager */ > attribute nsIMsgAccount defaultAccount; > > /** >- * ordered list of all accounts, by the order they are in the prefs >+ * ordered list of all accounts, by the order they are in the prefs. >+ * Accounts with hidden servers are not returned. nit: as you're adding the . please capitalise the 'ordered'.
Attachment #370488 - Flags: review?(bugzilla) → review+
fix checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [b3ux][m4][has patch][needs review Standard8] → [b3ux][m4][has patch]
I landed a patch that didn't address Neil's comments - I've fixed that now.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: