Remove redundant nsICopyMessageListener .startMessage() and .endMessage() callbacks
Categories
(MailNews Core :: Backend, task)
Tracking
(Not tracked)
People
(Reporter: benc, Assigned: benc)
References
(Blocks 1 open bug)
Details
(Keywords: leave-open)
Attachments
(2 files)
|
13.59 KB,
patch
|
Details | Diff | Splinter Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
When copying messages (using messageservice copyMessage[s]()) the general nsICopyMessageListener callback sequence is:
beginCopy()- at the start of each messagecopyData()- as many times as required to transfer the message dataendCopy()- at the end of the message
.startMessage() is called only when copying a single message from local folder to local folder.
The current functionality in nsMsgLocalMailFolder::StartMessage() can easily be rolled into the .beginCopy() handling, but there are a whole bunch of tricky single-vs-multiple message copy issues. mCopyState->m_curCopyIndex acts differently if mCopyState->m_copyingMultipleMessages is set - there's a whole bunch of needless voodoo in there to iron out.
The non-local (IMAP, EWS) implementations of .startMessage() are no-ops, so can be ditched without problem.
.endMessage() doesn't seem to be used at all.
The attached patch is a partial roadmap. It removes the callbacks and redundant code, but gets tripped up on m_curCopyIndex.
.endMove() could be looked at too - it's called for moves, invoked right after .endCopy(), but only for certain combinations of source and dest folder types.
| Assignee | ||
Comment 1•9 months ago
|
||
Updated•9 months ago
|
| Assignee | ||
Updated•9 months ago
|
Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/28a0bce02166
Remove redundant var in nsLocalMailCopyState. r=mkmelin
| Assignee | ||
Comment 3•6 months ago
|
||
(In reply to Ben Campbell from comment #0)
.endMessage()doesn't seem to be used at all.
OK, that's not quite true.
Looks like .endMessage() is called when it copies (or moves) multiple messages from a IMAP folder into a local folder.
It's not used for single-message operations.
| Assignee | ||
Comment 4•6 months ago
•
|
||
(In reply to Ben Campbell from comment #0)
.startMessage()is called only when copying a single message from local folder to local folder.
This is wrong too. .startMessage() is called when it copies (or moves) multiple messages into a local folder from either local or IMAP.
But not for single-message copies/moves.
Description
•