Folder query API
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: Fallen, Unassigned)
References
Details
We have https://searchfox.org/comm-central/source/mailnews/base/util/folderUtils.jsm#171 which gives us the most recently used folders. I think we should consider exposing this as an API.
On the upside, doing so would allow us to define our own touch points for when a folder becomes recent, and add-ons using this API would have access to the same list.
On the downside, extensions could also just implement this on their own if they have an event when a folder is selected or otherwise becomes recent.
Reporter | ||
Comment 1•6 years ago
|
||
This bug could also be morphed to provide a query function for folders in accounts with specific limitations, e.g. they are recent, or contain a substring, etc.
Reporter | ||
Comment 2•6 years ago
|
||
How about this:
browser.folders.query({
accountId: 123, // Folders of a specific account
recent: true, // If specified, folders will be sorted by most recent folder and only recent will be returned
favorite: true, // Folder is marked favorite
unread: true, // Has unread messages. Not sure if we want to provide a min/max unread, I'm thinking not.
type: "folder" // MailFolder type
});
Reporter | ||
Comment 3•6 years ago
|
||
Another query mode that we may be able to fit in:
// Get the folder(s) selected in the current window
browser.folders.query({ windowId: browser.windows.WINDOW_ID_CURRENT, active: true });
This might conflict with the recent
option, so maybe having a separate browser.folders.getRecent()
would actually make more sense.
Reporter | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
It would be good to be able to find a folder matching certain properties. Finding the current one is possible already through the mailTabs
API, so I don't think we need that.
Updated•2 years ago
|
Description
•