aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/account.go9
-rw-r--r--widgets/dirlist.go2
-rw-r--r--widgets/msglist.go4
-rw-r--r--widgets/msgviewer.go16
-rw-r--r--widgets/providesmessage.go4
5 files changed, 18 insertions, 17 deletions
diff --git a/widgets/account.go b/widgets/account.go
index 0948c5c6..e08a2537 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -9,6 +9,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/lib/ui"
+ "git.sr.ht/~sircmpwn/aerc/models"
"git.sr.ht/~sircmpwn/aerc/worker"
"git.sr.ht/~sircmpwn/aerc/worker/types"
)
@@ -169,7 +170,7 @@ func (acct *AccountView) SelectedAccount() *AccountView {
return acct
}
-func (acct *AccountView) SelectedMessage() *types.MessageInfo {
+func (acct *AccountView) SelectedMessage() *models.MessageInfo {
return acct.msglist.Selected()
}
@@ -195,11 +196,11 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
acct.dirlist.UpdateList(nil)
}
case *types.DirectoryInfo:
- if store, ok := acct.msgStores[msg.Name]; ok {
+ if store, ok := acct.msgStores[msg.Info.Name]; ok {
store.Update(msg)
} else {
- store = lib.NewMessageStore(acct.worker, msg)
- acct.msgStores[msg.Name] = store
+ store = lib.NewMessageStore(acct.worker, msg.Info)
+ acct.msgStores[msg.Info.Name] = store
store.OnUpdate(func(_ *lib.MessageStore) {
store.OnUpdate(nil)
acct.msglist.SetStore(store)
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 4dc8fd2c..c5e4a0c0 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -55,7 +55,7 @@ func (dirlist *DirectoryList) UpdateList(done func(dirs []string)) {
switch msg := msg.(type) {
case *types.Directory:
- dirs = append(dirs, msg.Name)
+ dirs = append(dirs, msg.Dir.Name)
case *types.Done:
sort.Strings(dirs)
dirlist.store.Update(dirs)
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 211cbcea..70514789 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -11,7 +11,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/lib/ui"
- "git.sr.ht/~sircmpwn/aerc/worker/types"
+ "git.sr.ht/~sircmpwn/aerc/models"
)
type MessageList struct {
@@ -176,7 +176,7 @@ func (ml *MessageList) Empty() bool {
return store == nil || len(store.Uids) == 0
}
-func (ml *MessageList) Selected() *types.MessageInfo {
+func (ml *MessageList) Selected() *models.MessageInfo {
store := ml.Store()
return store.Messages[store.Uids[len(store.Uids)-ml.store.SelectedIndex()-1]]
}
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index b0ae79ed..6a645f9a 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -20,7 +20,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/config"
"git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/lib/ui"
- "git.sr.ht/~sircmpwn/aerc/worker/types"
+ "git.sr.ht/~sircmpwn/aerc/models"
)
var ansi = regexp.MustCompile("^\x1B\\[[0-?]*[ -/]*[@-~]")
@@ -31,7 +31,7 @@ type MessageViewer struct {
conf *config.AercConfig
err error
grid *ui.Grid
- msg *types.MessageInfo
+ msg *models.MessageInfo
switcher *PartSwitcher
store *lib.MessageStore
}
@@ -44,7 +44,7 @@ type PartSwitcher struct {
}
func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
- store *lib.MessageStore, msg *types.MessageInfo) *MessageViewer {
+ store *lib.MessageStore, msg *models.MessageInfo) *MessageViewer {
grid := ui.NewGrid().Rows([]ui.GridSpec{
{ui.SIZE_EXACT, 4}, // TODO: Based on number of header rows
@@ -112,7 +112,7 @@ handle_error:
}
func enumerateParts(conf *config.AercConfig, store *lib.MessageStore,
- msg *types.MessageInfo, body *imap.BodyStructure,
+ msg *models.MessageInfo, body *imap.BodyStructure,
showHeaders bool, index []int) ([]*PartViewer, error) {
var parts []*PartViewer
@@ -140,7 +140,7 @@ func enumerateParts(conf *config.AercConfig, store *lib.MessageStore,
}
func createSwitcher(switcher *PartSwitcher, conf *config.AercConfig,
- store *lib.MessageStore, msg *types.MessageInfo, showHeaders bool) error {
+ store *lib.MessageStore, msg *models.MessageInfo, showHeaders bool) error {
var err error
switcher.showHeaders = showHeaders
@@ -212,7 +212,7 @@ func (mv *MessageViewer) SelectedAccount() *AccountView {
return mv.acct
}
-func (mv *MessageViewer) SelectedMessage() *types.MessageInfo {
+func (mv *MessageViewer) SelectedMessage() *models.MessageInfo {
return mv.msg
}
@@ -321,7 +321,7 @@ type PartViewer struct {
fetched bool
filter *exec.Cmd
index []int
- msg *types.MessageInfo
+ msg *models.MessageInfo
pager *exec.Cmd
pagerin io.WriteCloser
part *imap.BodyStructure
@@ -333,7 +333,7 @@ type PartViewer struct {
}
func NewPartViewer(conf *config.AercConfig,
- store *lib.MessageStore, msg *types.MessageInfo,
+ store *lib.MessageStore, msg *models.MessageInfo,
part *imap.BodyStructure, showHeaders bool,
index []int) (*PartViewer, error) {
diff --git a/widgets/providesmessage.go b/widgets/providesmessage.go
index 4b716371..d8b1e771 100644
--- a/widgets/providesmessage.go
+++ b/widgets/providesmessage.go
@@ -5,7 +5,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/lib/ui"
- "git.sr.ht/~sircmpwn/aerc/worker/types"
+ "git.sr.ht/~sircmpwn/aerc/models"
)
type PartInfo struct {
@@ -19,6 +19,6 @@ type ProvidesMessage interface {
ui.Drawable
Store() *lib.MessageStore
SelectedAccount() *AccountView
- SelectedMessage() *types.MessageInfo
+ SelectedMessage() *models.MessageInfo
SelectedMessagePart() *PartInfo
}