mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
chore(GODT-2576): Connector can send any flags to Gluon
Requires Gluon bump: https://github.com/ProtonMail/gluon/pull/344
This commit is contained in:
2
go.mod
2
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.2.0
|
||||
github.com/ProtonMail/gluon v0.16.1-0.20230426114906-aed4b8adf482
|
||||
github.com/ProtonMail/gluon v0.16.1-0.20230427090931-8b3ec72985ec
|
||||
github.com/ProtonMail/go-autostart v0.0.0-20210130080809-00ed301c8e9a
|
||||
github.com/ProtonMail/go-proton-api v0.4.1-0.20230426081144-f77778bae1be
|
||||
github.com/ProtonMail/gopenpgp/v2 v2.7.1-proton
|
||||
|
||||
2
go.sum
2
go.sum
@ -30,6 +30,8 @@ github.com/ProtonMail/docker-credential-helpers v1.1.0 h1:+kvUIpwWcbtP3WFv5sSvkF
|
||||
github.com/ProtonMail/docker-credential-helpers v1.1.0/go.mod h1:mK0aBveCxhnQ756AmaTfXMZDeULvheYVhF/MWMErN5g=
|
||||
github.com/ProtonMail/gluon v0.16.1-0.20230426114906-aed4b8adf482 h1:GvaYoE4Nj/l9L7hQnhGlu9s+IP6oqb4YPKR37GAjE+Y=
|
||||
github.com/ProtonMail/gluon v0.16.1-0.20230426114906-aed4b8adf482/go.mod h1:yA4hk6CJw0BMo+YL8Y3ckCYs5L20sysu9xseshwY3QI=
|
||||
github.com/ProtonMail/gluon v0.16.1-0.20230427090931-8b3ec72985ec h1:RRkoDUkPBjNBBkoDV02IAimxwWONmxP1bQ64jEDsAA0=
|
||||
github.com/ProtonMail/gluon v0.16.1-0.20230427090931-8b3ec72985ec/go.mod h1:yA4hk6CJw0BMo+YL8Y3ckCYs5L20sysu9xseshwY3QI=
|
||||
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=
|
||||
|
||||
@ -650,15 +650,28 @@ func (user *User) handleUpdateMessageEvent(ctx context.Context, message proton.M
|
||||
"subject": logging.Sensitive(message.Subject),
|
||||
}).Info("Handling message updated event")
|
||||
|
||||
flags := imap.NewFlagSet()
|
||||
|
||||
if message.Seen() {
|
||||
flags.AddToSelf(imap.FlagSeen)
|
||||
}
|
||||
|
||||
if message.Starred() {
|
||||
flags.AddToSelf(imap.FlagFlagged)
|
||||
}
|
||||
|
||||
if message.IsDraft() {
|
||||
flags.AddToSelf(imap.FlagDraft)
|
||||
}
|
||||
|
||||
if message.IsRepliedAll == true || message.IsReplied == true { //nolint: gosimple
|
||||
flags.AddToSelf(imap.FlagAnswered)
|
||||
}
|
||||
|
||||
update := imap.NewMessageMailboxesUpdated(
|
||||
imap.MessageID(message.ID),
|
||||
mapTo[string, imap.MailboxID](wantLabels(user.apiLabels, message.LabelIDs)),
|
||||
imap.MessageCustomFlags{
|
||||
Seen: message.Seen(),
|
||||
Flagged: message.Starred(),
|
||||
Draft: message.IsDraft(),
|
||||
Answered: message.IsRepliedAll == true || message.IsReplied == true, //nolint: gosimple
|
||||
},
|
||||
flags,
|
||||
)
|
||||
|
||||
user.updateCh[message.AddressID].Enqueue(update)
|
||||
|
||||
Reference in New Issue
Block a user