From e4efb374a1a57cc00829e7b796b9a2f2ceeccd02 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 20 Sep 2023 00:04:14 +0900 Subject: plugins/base: use imap.Flag for MessageRenderData.Flags map key Slightly more type-safe. --- plugins/base/routes.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/base/routes.go b/plugins/base/routes.go index 5176775..31313a2 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -404,7 +404,7 @@ type MessageRenderData struct { Part *IMAPPartNode View interface{} MailboxPage int - Flags map[string]bool + Flags map[imap.Flag]bool } func handleGetPart(ctx *alps.Context, raw bool) error { @@ -488,12 +488,12 @@ func handleGetPart(ctx *alps.Context, raw bool) error { view = nil } - flags := make(map[string]bool) + flags := make(map[imap.Flag]bool) for _, f := range selected.PermanentFlags { if f == imap.FlagWildcard { continue } - flags[string(f)] = msg.HasFlag(f) + flags[f] = msg.HasFlag(f) } ibase.BaseRenderData.WithTitle(msg.Envelope.Subject) -- cgit v1.2.3-59-g8ed1b