fix(GODT-2323): Fix Expunge not issued for move

When moving between system labels the expunge commands were not being
issued.
This commit is contained in:
Leander Beernaert
2023-02-01 15:53:27 +01:00
parent fbac5134ca
commit a955dcbaa9
4 changed files with 27 additions and 4 deletions

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/Masterminds/semver/v3 v3.1.1
github.com/ProtonMail/gluon v0.14.2-0.20230201115538-18e0b89693fc
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
github.com/ProtonMail/go-proton-api v0.3.1-0.20230130144605-4b05f1e5c427
github.com/ProtonMail/go-proton-api v0.3.1-0.20230202061850-e2fc4deffe20
github.com/ProtonMail/go-rfc5322 v0.11.0
github.com/ProtonMail/gopenpgp/v2 v2.4.10
github.com/PuerkitoBio/goquery v1.8.0

4
go.sum
View File

@ -41,8 +41,8 @@ github.com/ProtonMail/go-message v0.0.0-20210611055058-fabeff2ec753/go.mod h1:NB
github.com/ProtonMail/go-mime v0.0.0-20220302105931-303f85f7fe0f/go.mod h1:NYt+V3/4rEeDuaev/zw1zCq8uqVEuPHzDPo3OZrlGJ4=
github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f h1:4IWzKjHzZxdrW9k4zl/qCwenOVHDbVDADPPHFLjs0Oc=
github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f/go.mod h1:qRZgbeASl2a9OwmsV85aWwRqic0NHPh+9ewGAzb4cgM=
github.com/ProtonMail/go-proton-api v0.3.1-0.20230130144605-4b05f1e5c427 h1:M/sTrpruuxBtkeVFPoMd9WM2Kg36XlCTvYuv4q0urkg=
github.com/ProtonMail/go-proton-api v0.3.1-0.20230130144605-4b05f1e5c427/go.mod h1:JUo5IQG0hNuPRuDpOUsCOvtee6UjTEHHF1QN2i8RSos=
github.com/ProtonMail/go-proton-api v0.3.1-0.20230202061850-e2fc4deffe20 h1:EMDPJ/VrXRvlY9xZ9X2HZgdDh6285ikKnrW6psm0cf4=
github.com/ProtonMail/go-proton-api v0.3.1-0.20230202061850-e2fc4deffe20/go.mod h1:JUo5IQG0hNuPRuDpOUsCOvtee6UjTEHHF1QN2i8RSos=
github.com/ProtonMail/go-rfc5322 v0.11.0 h1:o5Obrm4DpmQEffvgsVqG6S4BKwC1Wat+hYwjIp2YcCY=
github.com/ProtonMail/go-rfc5322 v0.11.0/go.mod h1:6oOKr0jXvpoE6pwTx/HukigQpX2J9WUf6h0auplrFTw=
github.com/ProtonMail/go-srp v0.0.5 h1:xhUioxZgDbCnpo9JehyFhwwsn9JLWkUGfB0oiKXgiGg=

View File

@ -427,7 +427,7 @@ func (conn *imapConnector) MoveMessages(ctx context.Context, messageIDs []imap.M
result = result || true
}
if v, ok := conn.apiLabels[string(labelToID)]; ok && v.Type == proton.LabelTypeFolder {
if v, ok := conn.apiLabels[string(labelToID)]; ok && (v.Type == proton.LabelTypeFolder || v.Type == proton.LabelTypeSystem) {
result = result || true
}

View File

@ -64,6 +64,29 @@ Feature: IMAP move messages
| john.doe@mail.com | [user:user]@[domain] | baz | false |
And IMAP client "1" sees 0 messages in "Labels/label2"
Scenario: Move message from system label to system label
When IMAP client "1" moves the message with subject "foo" from "INBOX" to "Trash"
And it succeeds
And IMAP client "1" sees the following messages in "INBOX":
| from | to | subject | unread |
| jane.doe@mail.com | name@[domain] | bar | true |
And IMAP client "1" sees the following messages in "Trash":
| from | to | subject | unread |
| john.doe@mail.com | [user:user]@[domain] | foo | false |
Scenario: Move message from folder to system label
When IMAP client "1" moves the message with subject "baz" from "Labels/label2" to "Folders/mbox"
And it succeeds
And IMAP client "1" sees the following messages in "Folders/mbox":
| from | to | subject | unread |
| john.doe@mail.com | [user:user]@[domain] | baz | false |
When IMAP client "1" moves the message with subject "baz" from "Folders/mbox" to "Trash"
And it succeeds
And IMAP client "1" sees 0 messages in "Folders/mbox"
And IMAP client "1" sees the following messages in "Trash":
| from | to | subject | unread |
| john.doe@mail.com | [user:user]@[domain] | baz | false |
Scenario: Move message from All Mail is not possible
When IMAP client "1" moves the message with subject "baz" from "All Mail" to "Folders/folder"
Then it fails