Skip to content

Commit 43100d1

Browse files
LBeernaertProtoncuthix
authored andcommitted
fix(GODT-2323): Fix Expunge not issued for move
When moving between system labels the expunge commands were not being issued.
1 parent 4876314 commit 43100d1

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/Masterminds/semver/v3 v3.1.1
88
github.com/ProtonMail/gluon v0.14.2-0.20230207072331-53797c5aa3f6
99
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
10-
github.com/ProtonMail/go-proton-api v0.3.1-0.20230206154154-9a48fdf76620
10+
github.com/ProtonMail/go-proton-api v0.3.1-0.20230207122130-dd2095ddc7fe
1111
github.com/ProtonMail/go-rfc5322 v0.11.0
1212
github.com/ProtonMail/gopenpgp/v2 v2.4.10
1313
github.com/PuerkitoBio/goquery v1.8.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ github.com/ProtonMail/go-message v0.0.0-20210611055058-fabeff2ec753/go.mod h1:NB
4141
github.com/ProtonMail/go-mime v0.0.0-20220302105931-303f85f7fe0f/go.mod h1:NYt+V3/4rEeDuaev/zw1zCq8uqVEuPHzDPo3OZrlGJ4=
4242
github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f h1:4IWzKjHzZxdrW9k4zl/qCwenOVHDbVDADPPHFLjs0Oc=
4343
github.com/ProtonMail/go-mime v0.0.0-20220429130430-2192574d760f/go.mod h1:qRZgbeASl2a9OwmsV85aWwRqic0NHPh+9ewGAzb4cgM=
44-
github.com/ProtonMail/go-proton-api v0.3.1-0.20230206154154-9a48fdf76620 h1:I3yjl4TuEm1t56fKQ38OpvmFHSUrMH9eQ5I6C5Y3Bfc=
45-
github.com/ProtonMail/go-proton-api v0.3.1-0.20230206154154-9a48fdf76620/go.mod h1:JUo5IQG0hNuPRuDpOUsCOvtee6UjTEHHF1QN2i8RSos=
44+
github.com/ProtonMail/go-proton-api v0.3.1-0.20230207122130-dd2095ddc7fe h1:um5Kp4WLzq28G7JMafv9lpmXFxasyg4RI2MhEFRjoJY=
45+
github.com/ProtonMail/go-proton-api v0.3.1-0.20230207122130-dd2095ddc7fe/go.mod h1:JUo5IQG0hNuPRuDpOUsCOvtee6UjTEHHF1QN2i8RSos=
4646
github.com/ProtonMail/go-rfc5322 v0.11.0 h1:o5Obrm4DpmQEffvgsVqG6S4BKwC1Wat+hYwjIp2YcCY=
4747
github.com/ProtonMail/go-rfc5322 v0.11.0/go.mod h1:6oOKr0jXvpoE6pwTx/HukigQpX2J9WUf6h0auplrFTw=
4848
github.com/ProtonMail/go-srp v0.0.5 h1:xhUioxZgDbCnpo9JehyFhwwsn9JLWkUGfB0oiKXgiGg=

internal/user/imap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func (conn *imapConnector) MoveMessages(ctx context.Context, messageIDs []imap.M
443443
result = result || true
444444
}
445445

446-
if v, ok := conn.apiLabels[string(labelToID)]; ok && v.Type == proton.LabelTypeFolder {
446+
if v, ok := conn.apiLabels[string(labelToID)]; ok && (v.Type == proton.LabelTypeFolder || v.Type == proton.LabelTypeSystem) {
447447
result = result || true
448448
}
449449

tests/features/imap/message/move.feature

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@ Feature: IMAP move messages
6464
| john.doe@mail.com | [user:user]@[domain] | baz | false |
6565
And IMAP client "1" sees 0 messages in "Labels/label2"
6666

67+
Scenario: Move message from system label to system label
68+
When IMAP client "1" moves the message with subject "foo" from "INBOX" to "Trash"
69+
And it succeeds
70+
And IMAP client "1" sees the following messages in "INBOX":
71+
| from | to | subject | unread |
72+
| jane.doe@mail.com | name@[domain] | bar | true |
73+
And IMAP client "1" sees the following messages in "Trash":
74+
| from | to | subject | unread |
75+
| john.doe@mail.com | [user:user]@[domain] | foo | false |
76+
77+
Scenario: Move message from folder to system label
78+
When IMAP client "1" moves the message with subject "baz" from "Labels/label2" to "Folders/mbox"
79+
And it succeeds
80+
And IMAP client "1" sees the following messages in "Folders/mbox":
81+
| from | to | subject | unread |
82+
| john.doe@mail.com | [user:user]@[domain] | baz | false |
83+
When IMAP client "1" moves the message with subject "baz" from "Folders/mbox" to "Trash"
84+
And it succeeds
85+
And IMAP client "1" sees 0 messages in "Folders/mbox"
86+
And IMAP client "1" sees the following messages in "Trash":
87+
| from | to | subject | unread |
88+
| john.doe@mail.com | [user:user]@[domain] | baz | false |
89+
6790
Scenario: Move message from All Mail is not possible
6891
When IMAP client "1" moves the message with subject "baz" from "All Mail" to "Folders/folder"
6992
Then it fails

0 commit comments

Comments
 (0)