aboutsummaryrefslogtreecommitdiffstats
path: root/worker/mbox/models.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/models.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/models.go')
-rw-r--r--worker/mbox/models.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/worker/mbox/models.go b/worker/mbox/models.go
index 491128c5..5acd6f5a 100644
--- a/worker/mbox/models.go
+++ b/worker/mbox/models.go
@@ -5,8 +5,8 @@ import (
"fmt"
"io"
+ "git.sr.ht/~rjarry/aerc/lib/rfc822"
"git.sr.ht/~rjarry/aerc/models"
- "git.sr.ht/~rjarry/aerc/worker/lib"
)
type mailboxContainer struct {
@@ -91,7 +91,7 @@ func (md *mailboxContainer) Copy(dest, src string, uids []uint32) error {
type container struct {
filename string
- messages []lib.RawMessage
+ messages []rfc822.RawMessage
}
func (f *container) Uids() []uint32 {
@@ -102,7 +102,7 @@ func (f *container) Uids() []uint32 {
return uids
}
-func (f *container) Message(uid uint32) (lib.RawMessage, error) {
+func (f *container) Message(uid uint32) (rfc822.RawMessage, error) {
for _, m := range f.messages {
if uid == m.UID() {
return m, nil
@@ -112,7 +112,7 @@ func (f *container) Message(uid uint32) (lib.RawMessage, error) {
}
func (f *container) Delete(uids []uint32) (deleted []uint32) {
- newMessages := make([]lib.RawMessage, 0)
+ newMessages := make([]rfc822.RawMessage, 0)
for _, m := range f.messages {
del := false
for _, uid := range uids {