about summary refs log tree commit diff stats
path: root/lib/format/format.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2019-12-18 06:34:07 +0100
committerDrew DeVault <sir@cmpwn.com>2019-12-21 09:27:53 -0500
commitb9d2938f9fd13c290f187901c2fd43c957a24dd7 (patch)
tree5dd35d07dd56f851752fb6e16dc187ccd51d9f33 /lib/format/format.go
parenta744df724f8b7acb0ac231a615192d33c414012e (diff)
downloadaerc-b9d2938f9fd13c290f187901c2fd43c957a24dd7.tar.gz
msglist: highlight marked messages
Note that, until we get color configuration, this means that the user *must*
have the %Z verb in the index format else it'll be horribly confusing
as no visual indication is provided
Diffstat (limited to 'lib/format/format.go')
-rw-r--r--lib/format/format.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/format/format.go b/lib/format/format.go
index 53d93aa..6d638c6 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -22,7 +22,8 @@ func parseAddress(address string) *gomail.Address {
 func ParseMessageFormat(
 	fromAddress string,
 	format string, timestampformat string,
-	accountName string, number int, msg *models.MessageInfo) (string,
+	accountName string, number int, msg *models.MessageInfo,
+	marked bool) (string,
 	[]interface{}, error) {
 	retval := make([]byte, 0, len(format))
 	var args []interface{}
@@ -202,6 +203,7 @@ func ParseMessageFormat(
 			var readReplyFlag = ""
 			var delFlag = ""
 			var flaggedFlag = ""
+			var markedFlag = ""
 			seen := false
 			recent := false
 			answered := false
@@ -233,8 +235,11 @@ func ParseMessageFormat(
 					readReplyFlag = "O" // message is old
 				}
 			}
+			if marked {
+				markedFlag = "*"
+			}
 			retval = append(retval, '3', 's')
-			args = append(args, readReplyFlag+delFlag+flaggedFlag)
+			args = append(args, readReplyFlag+delFlag+flaggedFlag+markedFlag)
 
 		// Move the below cases to proper alphabetical positions once
 		// implemented