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

@ -38,7 +38,7 @@ type panicHandler interface {
type imapBackend struct {
panicHandler panicHandler
bridge bridger
updates chan interface{}
updates chan goIMAPBackend.Update
eventListener listener.Listener
users map[string]*imapUser
@ -80,7 +80,7 @@ func newIMAPBackend(
return &imapBackend{
panicHandler: panicHandler,
bridge: bridge,
updates: make(chan interface{}),
updates: make(chan goIMAPBackend.Update),
eventListener: eventListener,
users: map[string]*imapUser{},
@ -180,7 +180,7 @@ func (ib *imapBackend) Login(_ *imap.ConnInfo, username, password string) (goIMA
}
// Updates returns a channel of updates for IMAP IDLE extension.
func (ib *imapBackend) Updates() <-chan interface{} {
func (ib *imapBackend) Updates() <-chan goIMAPBackend.Update {
// Called from go-imap in goroutines - we need to handle panics for each function.
defer ib.panicHandler.HandlePanic()