GODT-1815: Upgrade to liteapi v0.31.0

This commit is contained in:
James Houlahan
2022-09-30 09:16:00 +02:00
parent 39433fe707
commit 1da1188351
6 changed files with 6 additions and 36 deletions

2
go.mod
View File

@ -37,7 +37,7 @@ require (
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.0
github.com/urfave/cli/v2 v2.16.3
gitlab.protontech.ch/go/liteapi v0.30.0
gitlab.protontech.ch/go/liteapi v0.31.0
golang.org/x/exp v0.0.0-20220921164117-439092de6870
golang.org/x/net v0.1.0
golang.org/x/sys v0.1.0

4
go.sum
View File

@ -463,8 +463,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zclconf/go-cty v1.11.0 h1:726SxLdi2SDnjY+BStqB9J1hNp4+2WlzyXLuimibIe0=
github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA=
gitlab.protontech.ch/go/liteapi v0.30.0 h1:ZpYLDC7LH3nn+O0+SgsTx4YNbU2pIj5fu3jcLvTXWbs=
gitlab.protontech.ch/go/liteapi v0.30.0/go.mod h1:ixp1LUOxOYuB1qf172GdV0ZT8fOomKxVFtIMZeSWg+I=
gitlab.protontech.ch/go/liteapi v0.31.0 h1:Et3P2EyTySldgBunFJqaa5W5Fap8yLvuOaLUkZX/Kn0=
gitlab.protontech.ch/go/liteapi v0.31.0/go.mod h1:ixp1LUOxOYuB1qf172GdV0ZT8fOomKxVFtIMZeSWg+I=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=

View File

@ -1,30 +0,0 @@
package user
import (
"github.com/ProtonMail/gopenpgp/v2/crypto"
"gitlab.protontech.ch/go/liteapi"
)
func unlockKeyRings(user liteapi.User, addresses []liteapi.Address, keyPass []byte) (*crypto.KeyRing, map[string]*crypto.KeyRing, error) {
userKR, err := user.Keys.Unlock(keyPass, nil)
if err != nil {
return nil, nil, err
}
addrKRs := make(map[string]*crypto.KeyRing)
for _, address := range addresses {
if !address.HasKeys.Bool() {
continue
}
addrKR, err := address.Keys.Unlock(keyPass, userKR)
if err != nil {
return nil, nil, err
}
addrKRs[address.ID] = addrKR
}
return userKR, addrKRs, nil
}

View File

@ -203,7 +203,7 @@ func (user *User) handleMessageEvents(messageEvents []liteapi.MessageEvent) erro
user.updateCh <- imap.NewMessageLabelsUpdated(
imap.MessageID(event.ID),
imapLabelIDs(filterLabelIDs(event.Message.LabelIDs)),
!event.Message.Unread.Bool(),
bool(!event.Message.Unread),
slices.Contains(event.Message.LabelIDs, liteapi.StarredLabel),
)
}

View File

@ -175,7 +175,7 @@ func (conn *imapConnector) GetMessage(ctx context.Context, messageID imap.Messag
flags := imap.NewFlagSet()
if !message.Unread.Bool() {
if !message.Unread {
flags = flags.Add(imap.FlagSeen)
}

View File

@ -181,7 +181,7 @@ func getMessageCreatedUpdate(message liteapi.Message, literal []byte) (*imap.Mes
flags := imap.NewFlagSet()
if !message.Unread.Bool() {
if !message.Unread {
flags = flags.Add(imap.FlagSeen)
}