aboutsummaryrefslogtreecommitdiff
path: root/worker/types
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-03 16:10:16 -0400
committerBen Burwell <ben@benburwell.com>2019-07-04 22:03:04 -0400
commit91529df0fecc68d5b0fdbb682529ee545884e7c5 (patch)
tree45b64884521d2df84dc057c99919f03240600344 /worker/types
parentf9f523ad59491eda08003ce2ccc6d57d7f19ea1e (diff)
Factor UI models out of the worker message package
Before, the information needed to display different parts of the UI was tightly coupled to the specific messages being sent back and forth to the backend worker. Separating out a models package allows us to be more specific about exactly what a backend is able to and required to provide for the UI.
Diffstat (limited to 'worker/types')
-rw-r--r--worker/types/messages.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/worker/types/messages.go b/worker/types/messages.go
index d9e911f..7eac896 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -5,9 +5,9 @@ import (
"time"
"github.com/emersion/go-imap"
- "github.com/emersion/go-message/mail"
"git.sr.ht/~sircmpwn/aerc/config"
+ "git.sr.ht/~sircmpwn/aerc/models"
)
type WorkerMessage interface {
@@ -164,25 +164,17 @@ type SearchResults struct {
type MessageInfo struct {
Message
- BodyStructure *imap.BodyStructure
- Envelope *imap.Envelope
- Flags []string
- InternalDate time.Time
- RFC822Headers *mail.Header
- Size uint32
- Uid uint32
+ Info *models.MessageInfo
}
type FullMessage struct {
Message
- Reader io.Reader
- Uid uint32
+ Content *models.FullMessage
}
type MessageBodyPart struct {
Message
- Reader io.Reader
- Uid uint32
+ Part *models.MessageBodyPart
}
type MessagesDeleted struct {