forked from Silverfish/proton-bridge
GODT-1815: Upgrade to liteapi v0.31.0
This commit is contained in:
@ -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
|
||||
}
|
||||
@ -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),
|
||||
)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user