summary refs log tree commit diff stats
path: root/commands/account
diff options
context:
space:
mode:
Diffstat (limited to 'commands/account')
-rw-r--r--commands/account/search.go27
1 files changed, 1 insertions, 26 deletions
diff --git a/commands/account/search.go b/commands/account/search.go
index da7ab03..ca51917 100644
--- a/commands/account/search.go
+++ b/commands/account/search.go
@@ -3,9 +3,6 @@ package account
 import (
 	"errors"
 
-	"git.sr.ht/~sircmpwn/getopt"
-	"github.com/emersion/go-imap"
-
 	"git.sr.ht/~sircmpwn/aerc/widgets"
 )
 
@@ -24,28 +21,6 @@ func (_ SearchFilter) Complete(aerc *widgets.Aerc, args []string) []string {
 }
 
 func (_ SearchFilter) Execute(aerc *widgets.Aerc, args []string) error {
-	var (
-		criteria *imap.SearchCriteria = imap.NewSearchCriteria()
-	)
-
-	opts, optind, err := getopt.Getopts(args, "ruH:")
-	if err != nil {
-		return err
-	}
-	for _, opt := range opts {
-		switch opt.Option {
-		case 'r':
-			criteria.WithFlags = append(criteria.WithFlags, imap.SeenFlag)
-		case 'u':
-			criteria.WithoutFlags = append(criteria.WithoutFlags, imap.SeenFlag)
-		case 'H':
-			// TODO
-		}
-	}
-	for _, arg := range args[optind:] {
-		criteria.Header.Add("Subject", arg)
-	}
-
 	acct := aerc.SelectedAccount()
 	if acct == nil {
 		return errors.New("No account selected")
@@ -73,6 +48,6 @@ func (_ SearchFilter) Execute(aerc *widgets.Aerc, args []string) error {
 			acct.Messages().Scroll()
 		}
 	}
-	store.Search(criteria, cb)
+	store.Search(args, cb)
 	return nil
 }