diff options
author | Bence Ferdinandy <bence@ferdinandy.com> | 2022-11-04 21:23:53 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-11-09 21:16:42 +0100 |
commit | c84d91ad9f36c601a938fcbc0ebc29eb9a0e13fc (patch) | |
tree | bd84610ffb4416b14358f5045a00f713d7de90e0 | |
parent | 931564e8743fee58890b85b9bb5fa628d05f7342 (diff) | |
download | aerc-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.go | 11 |
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 } |