diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/account/import-mbox.go | 2 | ||||
-rw-r--r-- | commands/compose/postpone.go | 2 | ||||
-rw-r--r-- | commands/compose/send.go | 2 | ||||
-rw-r--r-- | commands/msg/read.go | 11 |
4 files changed, 5 insertions, 12 deletions
diff --git a/commands/account/import-mbox.go b/commands/account/import-mbox.go index 7dab1958..b03d8d78 100644 --- a/commands/account/import-mbox.go +++ b/commands/account/import-mbox.go @@ -84,7 +84,7 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { nbytes, _ := io.Copy(&buf, r) worker.PostAction(&types.AppendMessage{ Destination: folder, - Flags: []models.Flag{models.SeenFlag}, + Flags: models.SeenFlag, Date: time.Now(), Reader: &buf, Length: int(nbytes), diff --git a/commands/compose/postpone.go b/commands/compose/postpone.go index eb7bc0a3..cc709ff7 100644 --- a/commands/compose/postpone.go +++ b/commands/compose/postpone.go @@ -95,7 +95,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error { nbytes := int(ctr.Count()) worker.PostAction(&types.AppendMessage{ Destination: config.Postpone, - Flags: []models.Flag{models.SeenFlag}, + Flags: models.SeenFlag, Date: time.Now(), Reader: &buf, Length: int(nbytes), diff --git a/commands/compose/send.go b/commands/compose/send.go index c5f4be3b..4c2b0503 100644 --- a/commands/compose/send.go +++ b/commands/compose/send.go @@ -502,7 +502,7 @@ func copyToSent(worker *types.Worker, dest string, errCh := make(chan error) worker.PostAction(&types.AppendMessage{ Destination: dest, - Flags: []models.Flag{models.SeenFlag}, + Flags: models.SeenFlag, Date: time.Now(), Reader: msg, Length: n, diff --git a/commands/msg/read.go b/commands/msg/read.go index 878dc3c8..cffd2218 100644 --- a/commands/msg/read.go +++ b/commands/msg/read.go @@ -34,7 +34,7 @@ func (FlagMsg) Complete(aerc *widgets.Aerc, args []string) []string { // 'flag' or 'unflag', respectively, but the 'Seen' flag is affected. func (FlagMsg) Execute(aerc *widgets.Aerc, args []string) error { // The flag to change - var flag models.Flag + var flag models.Flags // User-readable name of the flag to change var flagName string // Whether to toggle the flag (true) or to enable/disable it (false) @@ -130,14 +130,7 @@ func (FlagMsg) Execute(aerc *widgets.Aerc, args []string) error { return err } for _, m := range msgs { - var enabled bool - for _, mFlag := range m.Flags { - if mFlag == flag { - enabled = true - break - } - } - if enabled { + if m.Flags.Has(flag) { toDisable = append(toDisable, m.Uid) } else { toEnable = append(toEnable, m.Uid) |