Do not explicitly unlabel folders during move

This commit is contained in:
Michal Horejsek
2021-01-08 08:39:18 +01:00
parent 9193205834
commit 6c96643d12
3 changed files with 13 additions and 1 deletions

View File

@ -249,7 +249,10 @@ func (im *imapMailbox) labelMessages(uid bool, seqSet *imap.SeqSet, targetLabel
if err := targetStoreMailbox.LabelMessages(messageIDs); err != nil {
return err
}
if move {
// Folder cannot be unlabeled. Every message has to belong to exactly one folder.
// In case of labeling message to folder, the original one is implicitly unlabeled.
// Therefore, we have to unlabel explicitly only if the source mailbox is label.
if im.storeMailbox.IsLabel() && move {
if err := im.storeMailbox.UnlabelMessages(messageIDs); err != nil {
return err
}