Messages API function to move or copy messages
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(1 file, 2 obsolete files)
19.28 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
This should be pretty easy, using the message copy service. We'll need a new permission, since I don't think messagesRead
should cover it. I originally planned to call it messagesWrite
, but I may change my mind.
Assignee | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
I've since discovered I can't do the permissions in a way that messagesWrite implies messagesRead, so that string will be changing.
(In reply to Philipp Kewisch [:Fallen] [:📆] from comment #3)
This would wait for the first copy to finish before it does the next. Can
you either collect the messages up front into one array and then copy them
all, or save the promises and then await Promise.all() ?
I can't see the first option working as for some reason the source folder must be specified. The second option sounds okay, but can we do multiple operations like this at the same time? What if there's many simultaneous operations?
Comment 5•6 years ago
|
||
If starting many copy ops at the same time will result in performance or dataloss issues we should be sure to fix them in the copy service. We could chunk the promises array, but I think in WX code is the wrong place to do rate limiting.
Assignee | ||
Comment 6•6 years ago
|
||
Still a WIP.
I've added the delete message this was missing plus some testing. It seems that deleteMessages is synchronous in some cases and not in others, which I haven't yet dealt with. I've got nowhere with allowUndo, that could be because I don't have a window.
Comment 7•6 years ago
|
||
Assignee | ||
Comment 8•6 years ago
|
||
With bug 1521706 fixed I think this is ready for review.
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
I think it's better if I rename that permission "messagesMove" or something like it. "messagesWrite" was never the right thing, but it's what I started using and never changed it.
Comment 11•6 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/132113b4ce51
Messages API function to move, copy, or delete messages; r=Fallen
Assignee | ||
Updated•6 years ago
|
Description
•