The WebExtension MailFolder type should expose parent folders
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement, P2)
Tracking
(thunderbird_esr78 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | wontfix |
People
(Reporter: Fallen, Assigned: TbSync)
References
Details
Attachments
(1 file)
Right now browser.accounts.list() will return accounts. The folders are a flat list of folders. The only way to guess what the relationship between folders is, is the path. The docs say that the path isn't predictable and shouldn't be relied on, so I think we need some way to know the hierarchical structure of the folders.
Reporter | ||
Comment 1•5 years ago
|
||
I think this is a bug we should prioritize, if we want to make major changes to the folders/accounts APIs we should do it as early as possible.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
Sort of. We still have no link to parent folders, which is why this is still open.
Comment 4•4 years ago
|
||
Updating the title to match what is still remaining.
Currently, for example, an add-on can get a folder for a message header, but would not be able to iterate up the path tree (e.g. to find the folder names or parent folders.
Assignee | ||
Comment 5•3 years ago
•
|
||
Requests / use cases for parent folders include:
- get current hierarchy level
- get all names of each parent folder
- get the root folder
There are multiple ways to accomplish this
- Add a
parentFolder
property in MailFolder type, holding the MailFolder of the parent Folder. If no parent avail (=root), return null.
WebExt have to manually walk backwards to get all the information.
- Add a
parentFolders
property, being an array of MailFolders of all parent folders up to the root (flat ordered list)
No need to walk, all the information is right there.
-
Instead of adding a property
parentFolder
, add a methodgetParentFolder
-
Instead of adding a property
parentFolders
, add a methodgetParentFolders
What do you think? Did I forget something?
Comment 6•3 years ago
|
||
I think maybe a getParentFolders()
method is probably best.
Having a property on MailFolder feels like it might be extra work in the API, that we don't always need. browser.accounts.list()
can be quite slow, so doing the least work possible there would be best. It would also avoid unnecessary slowing down other functions that return folders.
Getting all the parents rather than just the one would also be nicer, since if you're iterating up, that's potentially what you're going to need anyway.
Assignee | ||
Comment 7•3 years ago
|
||
Ok, option 4. Patch is coming.
Assignee | ||
Comment 8•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/46773c2a2cf3
Add getParentFolders and getSubFolders methods to folders API. r=darktrojan
Updated•3 years ago
|
Description
•