summary refs log tree commit diff stats
path: root/worker/imap/search.go
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2019-09-20 17:26:17 +0100
committerDrew DeVault <sir@cmpwn.com>2019-09-20 15:06:54 -0400
commitd2a18e267c5d8908377d5a73172bd4313edc4891 (patch)
treebd4018773ff535da4d53177b47756c00926c0b0e /worker/imap/search.go
parent39307a6fa7e96641b822ed0a9acb75021dcf7fe9 (diff)
downloadaerc-d2a18e267c5d8908377d5a73172bd4313edc4891.tar.gz
Change search flags
This changes the search flags for maildir and imap backends.

They now no longer use -t for searching all text. This seems to make
more sense as being the targeted recipient. I have similarly added Cc
for -c. The text search now resides under -a for all text.
Diffstat (limited to 'worker/imap/search.go')
-rw-r--r--worker/imap/search.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/worker/imap/search.go b/worker/imap/search.go
index 939516d..42e155b 100644
--- a/worker/imap/search.go
+++ b/worker/imap/search.go
@@ -9,7 +9,7 @@ import (
 func parseSearch(args []string) (*imap.SearchCriteria, error) {
 	criteria := imap.NewSearchCriteria()
 
-	opts, optind, err := getopt.Getopts(args, "rubtH:f:")
+	opts, optind, err := getopt.Getopts(args, "rubat:H:f:c:")
 	if err != nil {
 		return nil, err
 	}
@@ -25,9 +25,13 @@ func parseSearch(args []string) (*imap.SearchCriteria, error) {
 			// TODO
 		case 'f':
 			criteria.Header.Add("From", opt.Value)
+		case 't':
+			criteria.Header.Add("To", opt.Value)
+		case 'c':
+			criteria.Header.Add("Cc", opt.Value)
 		case 'b':
 			body = true
-		case 't':
+		case 'a':
 			text = true
 		}
 	}