aboutsummaryrefslogtreecommitdiffstats
path: root/worker/mbox/io.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-10-17 14:40:08 +0200
committerRobin Jarry <robin@jarry.cc>2023-10-28 19:24:55 +0200
commit57088312fdd8e602a084bd5736a0e22a34be9ec0 (patch)
tree8c5544262cf8c1772ec661748cfa4d5491ff4c77 /worker/mbox/io.go
parent591659b52867cb118d1f82d41693a02123935e0c (diff)
downloadaerc-57088312fdd8e602a084bd5736a0e22a34be9ec0.tar.gz
worker: move shared code to lib
Avoid importing code from worker/lib into lib. It should only be the other way around. Move the message parsing code used by maildir, notmuch, mbox and the eml viewer into a lib/rfc822 package. Adapt imports accordingly. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Tested-by: Inwit <inwit@sindominio.net>
Diffstat (limited to 'worker/mbox/io.go')
-rw-r--r--worker/mbox/io.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/worker/mbox/io.go b/worker/mbox/io.go
index 2fe39813..f5fbc596 100644
--- a/worker/mbox/io.go
+++ b/worker/mbox/io.go
@@ -5,15 +5,15 @@ import (
"io"
"time"
+ "git.sr.ht/~rjarry/aerc/lib/rfc822"
"git.sr.ht/~rjarry/aerc/models"
- "git.sr.ht/~rjarry/aerc/worker/lib"
"github.com/emersion/go-mbox"
)
-func Read(r io.Reader) ([]lib.RawMessage, error) {
+func Read(r io.Reader) ([]rfc822.RawMessage, error) {
mbr := mbox.NewReader(r)
uid := uint32(0)
- messages := make([]lib.RawMessage, 0)
+ messages := make([]rfc822.RawMessage, 0)
for {
msg, err := mbr.NextMessage()
if errors.Is(err, io.EOF) {