From 227bbf1c031600d4ca04c7557e29bacae9acf4f9 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Mon, 6 Mar 2023 13:02:19 +0100 Subject: [PATCH] fix(GODT-2425): Out of sync messages and read status Apply fix required for gluon update. Update Gluon to include revision where the fix was made. Includes: * https://github.com/ProtonMail/gluon/pull/313 * https://github.com/ProtonMail/gluon/pull/316 * https://github.com/ProtonMail/gluon/pull/317 --- go.mod | 2 +- go.sum | 6 ++---- internal/user/events.go | 8 ++++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 23bef0ef..3f667d44 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/0xAX/notificator v0.0.0-20220220101646-ee9b8921e557 github.com/Masterminds/semver/v3 v3.1.1 - github.com/ProtonMail/gluon v0.14.2-0.20230302123434-303e813f9e80 + github.com/ProtonMail/gluon v0.14.2-0.20230306115955-a6b5ddffeb18 github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a github.com/ProtonMail/go-proton-api v0.3.1-0.20230209110241-fe7894c4931a github.com/ProtonMail/go-rfc5322 v0.11.0 diff --git a/go.sum b/go.sum index 2cfa619c..40a26f80 100644 --- a/go.sum +++ b/go.sum @@ -28,10 +28,8 @@ github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf h1:yc9daCCYUefEs github.com/ProtonMail/bcrypt v0.0.0-20211005172633-e235017c1baf/go.mod h1:o0ESU9p83twszAU8LBeJKFAAMX14tISa0yk4Oo5TOqo= github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkFn/XLzSqPOB5AAthuk9xPk= github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g= -github.com/ProtonMail/gluon v0.14.2-0.20230228154054-7b2d621cdfd0 h1:wLUaWZ15jn14V7TJ/mXvAPQEjsoX2d3KDxbBgohzt/c= -github.com/ProtonMail/gluon v0.14.2-0.20230228154054-7b2d621cdfd0/go.mod h1:z2AxLIiBCT1K+0OBHyaDI7AEaO5qI6/BEC2TE42vs4Q= -github.com/ProtonMail/gluon v0.14.2-0.20230302123434-303e813f9e80 h1:0OWYIOKaT+VnLSPzJEEzGK60pN34LLwZpgCpO4GuSuU= -github.com/ProtonMail/gluon v0.14.2-0.20230302123434-303e813f9e80/go.mod h1:z2AxLIiBCT1K+0OBHyaDI7AEaO5qI6/BEC2TE42vs4Q= +github.com/ProtonMail/gluon v0.14.2-0.20230306115955-a6b5ddffeb18 h1:X4UZxU7RYtZKz72HWDRbAndAzRZOiMHH/HucSg+u0oo= +github.com/ProtonMail/gluon v0.14.2-0.20230306115955-a6b5ddffeb18/go.mod h1:z2AxLIiBCT1K+0OBHyaDI7AEaO5qI6/BEC2TE42vs4Q= github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a h1:D+aZah+k14Gn6kmL7eKxoo/4Dr/lK3ChBcwce2+SQP4= github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a/go.mod h1:oTGdE7/DlWIr23G0IKW3OXK9wZ5Hw1GGiaJFccTvZi4= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= diff --git a/internal/user/events.go b/internal/user/events.go index 296243be..8e8470b9 100644 --- a/internal/user/events.go +++ b/internal/user/events.go @@ -580,8 +580,12 @@ func (user *User) handleUpdateMessageEvent(ctx context.Context, message proton.M update := imap.NewMessageMailboxesUpdated( imap.MessageID(message.ID), mapTo[string, imap.MailboxID](wantLabels(user.apiLabels, message.LabelIDs)), - message.Seen(), - message.Starred(), + imap.MessageCustomFlags{ + Seen: message.Seen(), + Flagged: message.Starred(), + Draft: message.IsDraft(), + Answered: message.IsReplied == true || message.IsRepliedAll == true, //nolint: gosimple + }, ) user.updateCh[message.AddressID].Enqueue(update)