forked from Silverfish/proton-bridge
Other refactor: clean old builder
This commit is contained in:
@ -22,13 +22,14 @@ import (
|
||||
"github.com/emersion/go-imap"
|
||||
)
|
||||
|
||||
//nolint[gochecknoglobals]
|
||||
var (
|
||||
AppleMailJunkFlag = imap.CanonicalFlag("$Junk")
|
||||
ThunderbirdJunkFlag = imap.CanonicalFlag("Junk")
|
||||
ThunderbirdNonJunkFlag = imap.CanonicalFlag("NonJunk")
|
||||
// Various client specific flags.
|
||||
const (
|
||||
AppleMailJunkFlag = "$Junk"
|
||||
ThunderbirdJunkFlag = "Junk"
|
||||
ThunderbirdNonJunkFlag = "NonJunk"
|
||||
)
|
||||
|
||||
// GetFlags returns imap flags from pmapi message attributes.
|
||||
func GetFlags(m *pmapi.Message) (flags []string) {
|
||||
if m.Unread == 0 {
|
||||
flags = append(flags, imap.SeenFlag)
|
||||
@ -59,6 +60,7 @@ func GetFlags(m *pmapi.Message) (flags []string) {
|
||||
return
|
||||
}
|
||||
|
||||
// ParseFlags sets attributes to pmapi messages based on imap flags.
|
||||
func ParseFlags(m *pmapi.Message, flags []string) {
|
||||
if m.Header.Get("received") == "" {
|
||||
m.Flags = pmapi.FlagSent
|
||||
|
||||
Reference in New Issue
Block a user