Folder query API
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(thunderbird_esr115 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr115 | --- | wontfix |
People
(Reporter: Fallen, Assigned: TbSync)
References
Details
Attachments
(3 files)
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
|
Assignee | ||
Comment 5•1 year ago
|
||
Depends on D191658
Updated•1 year ago
|
Assignee | ||
Comment 6•1 year ago
|
||
Depends on D191729
Updated•1 year ago
|
Assignee | ||
Comment 7•1 year ago
|
||
I just found bug 1840039, where @:Fallen adds the following information:
It would be great to have messenger.folders.query to search for folders that match criteria. I haven't thought out all the use cases, but here are my immediate needs for quickmove:
recent: true - a special mode that will return recent folders by MRUTime.
limit: NNN - limit the number of folders to return
canFileMessages: true - only return folders where messages can be filed in
Here are a few others from nsIMsgFolder that might make sense, though we certainly don't have to implement all of them:
canSubscribe
canDeleteMessages
deletable
canCreateSubfolders
canRename
hasNewMessages
folder type
hasSubfolers
Here is a crude start: https://github.com/kewisch/quickmove-extension/blob/7f9ac419d30f48649ff15fef45d9f672b439402c/api/api.js#L90
Assignee | ||
Comment 9•1 year ago
|
||
Depends on D191729
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 11•1 year ago
|
||
Pushed by solange@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/e4c417a964c9
Move getFolder() in ExtensionAccounts.sys.mjs. r=mkmelin
https://hg.mozilla.org/comm-central/rev/34adc3a0db1f
Expose more folder properties and capabilities. r=mkmelin
https://hg.mozilla.org/comm-central/rev/dcc508446845
Add folders.query(). r=mkmelin
Comment 12•1 year ago
|
||
search bugmail for "addons1234" to delete these messages
Description
•