aboutsummaryrefslogtreecommitdiffstats
path: root/worker
diff options
context:
space:
mode:
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/fetch.go12
-rw-r--r--worker/types/messages.go7
2 files changed, 5 insertions, 14 deletions
diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go
index d2291267..8052e13a 100644
--- a/worker/imap/fetch.go
+++ b/worker/imap/fetch.go
@@ -2,7 +2,6 @@ package imap
import (
"github.com/emersion/go-imap"
- "github.com/mohamedattahri/mail"
"git.sr.ht/~sircmpwn/aerc2/worker/types"
)
@@ -45,16 +44,9 @@ func (imapw *IMAPWorker) handleFetchMessages(
for _msg := range messages {
imapw.seqMap[_msg.SeqNum-1] = _msg.Uid
if reader := _msg.GetBody(section); reader != nil {
- email, err := mail.ReadMessage(reader)
- if err != nil {
- imapw.worker.PostMessage(&types.Error{
- Message: types.RespondTo(msg),
- Error: err,
- }, nil)
- }
imapw.worker.PostMessage(&types.MessageBody{
- Mail: email,
- Uid: _msg.Uid,
+ Reader: reader,
+ Uid: _msg.Uid,
}, nil)
} else {
imapw.worker.PostMessage(&types.MessageInfo{
diff --git a/worker/types/messages.go b/worker/types/messages.go
index b1d1485e..803bb98f 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -6,7 +6,6 @@ import (
"time"
"github.com/emersion/go-imap"
- "github.com/mohamedattahri/mail"
"git.sr.ht/~sircmpwn/aerc2/config"
)
@@ -137,13 +136,13 @@ type MessageInfo struct {
type MessageBody struct {
Message
- Mail *mail.Message
- Uid uint32
+ Reader io.Reader
+ Uid uint32
}
type MessageBodyPart struct {
Message
- Reader *io.Reader
+ Reader io.Reader
Uid uint32
}