aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/msglist.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-10-14 08:42:26 +0200
committerReto Brunner <reto@labrat.space>2020-10-14 08:42:26 +0200
commit75cbf767326dfc67325773850ab1f6451dc9fb14 (patch)
tree4b47de3da4944ed2a84a7f175a742fda3dd2ea24 /widgets/msglist.go
parentb6bcf89784605aa8baa982677de9d8d8ddbaa404 (diff)
downloadaerc-75cbf767326dfc67325773850ab1f6451dc9fb14.tar.gz
refactor ParseMessageFormat to use a ctx object
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r--widgets/msglist.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 09b0868c..b7c10d7e 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -150,9 +150,14 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
ctx.Fill(0, row, ctx.Width(), 1, ' ', style)
fmtStr, args, err := format.ParseMessageFormat(
- ml.aerc.SelectedAccount().acct.From,
- uiConfig.IndexFormat,
- uiConfig.TimestampFormat, "", i, msg, store.IsMarked(uid))
+ uiConfig.IndexFormat, uiConfig.TimestampFormat,
+ format.Ctx{
+ FromAddress: ml.aerc.SelectedAccount().acct.From,
+ AccountName: ml.aerc.SelectedAccount().Name(),
+ MsgInfo: msg,
+ MsgNum: i,
+ MsgIsMarked: store.IsMarked(uid),
+ })
if err != nil {
ctx.Printf(0, row, style, "%v", err)
} else {