mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
Completely delete old draft instead moving to trash when user updates draft
This commit is contained in:
committed by
Jakub Cuth
parent
e962434c8f
commit
0c7a328165
@ -11,6 +11,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
### Changed
|
### Changed
|
||||||
* GODT-225 Do not send an EXISTS reposnse after EXPUNGE or when nothing changed (fixes rebuild of mailboxes in Outlook for Mac)
|
* GODT-225 Do not send an EXISTS reposnse after EXPUNGE or when nothing changed (fixes rebuild of mailboxes in Outlook for Mac)
|
||||||
* GODT-165 Optimization of RebuildMailboxes
|
* GODT-165 Optimization of RebuildMailboxes
|
||||||
|
* GODT-282 Completely delete old draft instead moving to trash when user updates draft
|
||||||
* Adding DSN Sentry as build time parameter
|
* Adding DSN Sentry as build time parameter
|
||||||
* GODT-124 bump go-appdir from v1.0.0 to v1.1.0
|
* GODT-124 bump go-appdir from v1.0.0 to v1.1.0
|
||||||
|
|
||||||
|
|||||||
@ -206,6 +206,10 @@ func (storeMailbox *Mailbox) DeleteMessages(apiIDs []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case pmapi.DraftLabel:
|
||||||
|
if err := storeMailbox.api().DeleteMessages(apiIDs); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
if err := storeMailbox.api().UnlabelMessages(apiIDs, storeMailbox.labelID); err != nil {
|
if err := storeMailbox.api().UnlabelMessages(apiIDs, storeMailbox.labelID); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -266,7 +270,7 @@ func (storeMailbox *Mailbox) txCreateOrUpdateMessages(tx *bolt.Tx, msgs []*pmapi
|
|||||||
|
|
||||||
// Draft bodies can change and bodies are not re-fetched by IMAP clients.
|
// Draft bodies can change and bodies are not re-fetched by IMAP clients.
|
||||||
// Every change has to be a new message; we need to delete the old one and always recreate it.
|
// Every change has to be a new message; we need to delete the old one and always recreate it.
|
||||||
if storeMailbox.labelID == pmapi.DraftLabel {
|
if msg.Type == pmapi.MessageTypeDraft {
|
||||||
if err := storeMailbox.txDeleteMessage(tx, msg.ID); err != nil {
|
if err := storeMailbox.txDeleteMessage(tx, msg.ID); err != nil {
|
||||||
return errors.Wrap(err, "cannot delete old draft")
|
return errors.Wrap(err, "cannot delete old draft")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user