aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2022-11-04 21:23:53 +0100
committerRobin Jarry <robin@jarry.cc>2022-11-09 21:16:42 +0100
commitc84d91ad9f36c601a938fcbc0ebc29eb9a0e13fc (patch)
treebd84610ffb4416b14358f5045a00f713d7de90e0
parent931564e8743fee58890b85b9bb5fa628d05f7342 (diff)
downloadaerc-c84d91ad9f36c601a938fcbc0ebc29eb9a0e13fc.tar.gz
maildir: speedup move to larger folders
When moving or archiving to a very large folder, aerc requests directory info, which can takes several seconds to receive. Also, when moving, we post a MessagesDeleted message. Remove unnecessary call to directory info and change posted message to the correct MessagesMoved. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
-rw-r--r--worker/maildir/worker.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index de7e8e89..fe4425e2 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -663,13 +663,10 @@ func (w *Worker) handleCopyMessages(msg *types.CopyMessages) error {
func (w *Worker) handleMoveMessages(msg *types.MoveMessages) error {
dest := w.c.Store.Dir(msg.Destination)
moved, err := w.c.MoveAll(dest, *w.selected, msg.Uids)
- destInfo := w.getDirectoryInfo(msg.Destination)
- w.worker.PostMessage(&types.DirectoryInfo{
- Info: destInfo,
- }, nil)
- w.worker.PostMessage(&types.MessagesDeleted{
- Message: types.RespondTo(msg),
- Uids: moved,
+ w.worker.PostMessage(&types.MessagesMoved{
+ Message: types.RespondTo(msg),
+ Destination: msg.Destination,
+ Uids: moved,
}, nil)
return err
}