aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account
diff options
context:
space:
mode:
Diffstat (limited to 'commands/account')
-rw-r--r--commands/account/clear.go2
-rw-r--r--commands/account/export-mbox.go19
-rw-r--r--commands/account/next.go2
-rw-r--r--commands/account/search.go2
4 files changed, 13 insertions, 12 deletions
diff --git a/commands/account/clear.go b/commands/account/clear.go
index 1c13ddf5..ec033c46 100644
--- a/commands/account/clear.go
+++ b/commands/account/clear.go
@@ -35,7 +35,7 @@ func (c Clear) Execute(args []string) error {
}
if c.Selected {
- defer store.Select(0)
+ defer store.Select("")
}
store.ApplyClear()
acct.SetStatus(state.SearchFilterClear())
diff --git a/commands/account/export-mbox.go b/commands/account/export-mbox.go
index 6422eae0..619c24a2 100644
--- a/commands/account/export-mbox.go
+++ b/commands/account/export-mbox.go
@@ -13,6 +13,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/log"
"git.sr.ht/~rjarry/aerc/lib/xdg"
+ "git.sr.ht/~rjarry/aerc/models"
mboxer "git.sr.ht/~rjarry/aerc/worker/mbox"
"git.sr.ht/~rjarry/aerc/worker/types"
)
@@ -61,7 +62,7 @@ func (e ExportMbox) Execute(args []string) error {
app.PushStatus("Exporting to "+e.Filename, 10*time.Second)
// uids of messages to export
- var uids []uint32
+ var uids []models.UID
// check if something is marked - we export that then
msgProvider, ok := app.SelectedTabContent().(app.ProvidesMessages)
@@ -98,7 +99,7 @@ func (e ExportMbox) Execute(args []string) error {
defer file.Close()
var mu sync.Mutex
- var ctr uint32
+ var ctr uint
var retries int
done := make(chan bool)
@@ -159,15 +160,15 @@ func (e ExportMbox) Execute(args []string) error {
return nil
}
-func sortMarkedUids(marked []uint32, store *lib.MessageStore) ([]uint32, error) {
- lookup := map[uint32]bool{}
+func sortMarkedUids(marked []models.UID, store *lib.MessageStore) ([]models.UID, error) {
+ lookup := map[models.UID]bool{}
for _, uid := range marked {
lookup[uid] = true
}
- uids := []uint32{}
+ uids := []models.UID{}
iter := store.UidsIterator()
for iter.Next() {
- uid, ok := iter.Value().(uint32)
+ uid, ok := iter.Value().(models.UID)
if !ok {
return nil, errors.New("Invalid message UID value")
}
@@ -179,11 +180,11 @@ func sortMarkedUids(marked []uint32, store *lib.MessageStore) ([]uint32, error)
return uids, nil
}
-func sortAllUids(store *lib.MessageStore) ([]uint32, error) {
- uids := []uint32{}
+func sortAllUids(store *lib.MessageStore) ([]models.UID, error) {
+ uids := []models.UID{}
iter := store.UidsIterator()
for iter.Next() {
- uid, ok := iter.Value().(uint32)
+ uid, ok := iter.Value().(models.UID)
if !ok {
return nil, errors.New("Invalid message UID value")
}
diff --git a/commands/account/next.go b/commands/account/next.go
index e14b14fb..b54ed0c1 100644
--- a/commands/account/next.go
+++ b/commands/account/next.go
@@ -85,7 +85,7 @@ func (np NextPrevMsg) Execute(args []string) error {
if nextMsg := store.Selected(); nextMsg != nil {
reloadViewer(nextMsg)
} else {
- store.FetchHeaders([]uint32{store.SelectedUid()},
+ store.FetchHeaders([]models.UID{store.SelectedUid()},
func(msg types.WorkerMessage) {
if m, ok := msg.(*types.MessageInfo); ok {
reloadViewer(m.Info)
diff --git a/commands/account/search.go b/commands/account/search.go
index 5c2eaec7..14aa367b 100644
--- a/commands/account/search.go
+++ b/commands/account/search.go
@@ -191,7 +191,7 @@ func (s SearchFilter) Execute(args []string) error {
store.Sort(store.GetCurrentSortCriteria(), cb)
} else {
acct.SetStatus(state.Search("Searching..."))
- cb := func(uids []uint32) {
+ cb := func(uids []models.UID) {
acct.SetStatus(state.Search(strings.Join(args, " ")))
log.Tracef("Search results: %v", uids)
store.ApplySearch(uids)