Ensure that flags are set properly

The current implementation has three classes of flags:
- readFlag
- delFlag
- flaggedFlag

The logic to check for them should be in parallel if branches rather
than in sequential if-else ladder.
This commit is contained in:
Aditya Mahajan 2019-06-14 17:11:17 -04:00 committed by Drew DeVault
parent ab79bc3447
commit 1b7790553e
1 changed files with 4 additions and 2 deletions

View File

@ -177,10 +177,12 @@ func ParseIndexFormat(conf *config.AercConfig, number int,
readFlag = "N" // message is new
} else if flag == imap.AnsweredFlag {
readFlag = "r" // message has been replied to
} else if flag == imap.DeletedFlag {
}
if flag == imap.DeletedFlag {
delFlag = "D"
// TODO: check if attachments
} else if flag == imap.FlaggedFlag {
}
if flag == imap.FlaggedFlag {
flaggedFlag = "!"
}
// TODO: check gpg stuff