Updates() needs to return imapBackend.Update instead of interface with go-imap v1

This commit is contained in:
Michal Horejsek
2020-04-24 09:12:46 +02:00
parent 313e803fdd
commit 1998d92432
6 changed files with 18 additions and 15 deletions

View File

@ -29,6 +29,7 @@ import (
"github.com/ProtonMail/proton-bridge/internal/store"
"github.com/ProtonMail/proton-bridge/pkg/listener"
"github.com/ProtonMail/proton-bridge/pkg/pmapi"
imapBackend "github.com/emersion/go-imap/backend"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@ -44,7 +45,7 @@ type User struct {
clientManager ClientManager
credStorer CredentialsStorer
imapUpdatesChannel chan interface{}
imapUpdatesChannel chan imapBackend.Update
store *store.Store
storeCache *store.Cache
@ -102,7 +103,7 @@ func (u *User) client() pmapi.Client {
// have the apitoken and password), authorising the user against the api, loading the user store (creating a new one
// if necessary), and setting the imap idle updates channel (used to send imap idle updates to the imap backend if
// something in the store changed).
func (u *User) init(idleUpdates chan interface{}) (err error) {
func (u *User) init(idleUpdates chan imapBackend.Update) (err error) {
u.unlockingKeyringLock.Lock()
u.wasKeyringUnlocked = false
u.unlockingKeyringLock.Unlock()