~sircmpwn/aerc

maildir: Preserve flags when copying messages v1 PROPOSED

Ben Burwell: 1
 maildir: Preserve flags when copying messages

 1 files changed, 2 insertions(+), 20 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/7398/mbox | git am -3
Learn more about email & git

[PATCH] maildir: Preserve flags when copying messages Export this patch

---
 worker/maildir/container.go | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/worker/maildir/container.go b/worker/maildir/container.go
index f015181..85e892a 100644
--- a/worker/maildir/container.go
+++ b/worker/maildir/container.go
@@ -2,7 +2,6 @@ package maildir

import (
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"path/filepath"
@@ -121,23 +120,6 @@ func (c *Container) copyMessage(
	if !ok {
		return fmt.Errorf("could not find key for message id %d", uid)
	}

	f, err := src.Open(key)
	if err != nil {
		return fmt.Errorf("could not open source message: %v", err)
	}

	del, err := dest.NewDelivery()
	if err != nil {
		return fmt.Errorf("could not initialize delivery: %v", err)
	}
	defer del.Close()

	if _, err = io.Copy(del, f); err != nil {
		return fmt.Errorf("could not copy message to delivery: %v", err)
	}

	// TODO: preserve flags

	return nil
	_, err := src.Copy(dest, key)
	return err
}
-- 
2.22.0
Ah, the best kind of patch: the one which removes a bunch of code.
Thanks!

To git.sr.ht:~sircmpwn/aerc
   072b5f4..a174941  master -> master
View this thread in the archives