when moving/copying messages in imapserve, also ensure the message keywords make it into the destination mailbox keywords list

This commit is contained in:
Mechiel Lukkien
2023-07-24 08:49:19 +02:00
parent f9e261e0fb
commit 2e5376d7eb
2 changed files with 35 additions and 6 deletions

View File

@ -292,7 +292,7 @@ type Message struct {
MessageHash []byte // Hash of message. For rejects delivery, so optional like MessageID.
Flags
Keywords []string `bstore:"index"` // Non-system or well-known $-flags. Only in "atom" syntax, stored in lower case.
Keywords []string `bstore:"index"` // For keywords other than system flags or the basic well-known $-flags. Only in "atom" syntax, stored in lower case.
Size int64
TrainedJunk *bool // If nil, no training done yet. Otherwise, true is trained as junk, false trained as nonjunk.
MsgPrefix []byte // Typically holds received headers and/or header separator.
@ -1345,7 +1345,7 @@ func RemoveKeywords(l, remove []string) []string {
func MergeKeywords(l, add []string) ([]string, bool) {
var changed bool
for _, k := range add {
if slices.Index(l, k) < 0 {
if !slices.Contains(l, k) {
l = append(l, k)
changed = true
}