Importing to sent and inbox

This commit is contained in:
Michal Horejsek
2021-01-08 13:00:26 +01:00
parent 0cde1ab801
commit 76dda10572
14 changed files with 218 additions and 41 deletions

View File

@ -60,10 +60,12 @@ func GetFlags(m *pmapi.Message) (flags []string) {
}
func ParseFlags(m *pmapi.Message, flags []string) {
// Consider to use ComputeMessageFlagsByLabels to keep logic in one place.
if (m.Flags & pmapi.FlagSent) == 0 {
m.Flags |= pmapi.FlagReceived
if m.Header.Get("received") == "" {
m.Flags = pmapi.FlagSent
} else {
m.Flags = pmapi.FlagReceived
}
m.Unread = 1
for _, f := range flags {
switch f {