feat(GODT-2295): notifications for IMAP login when signed out.

This commit is contained in:
Xavier Michelon
2023-02-02 18:19:40 +01:00
parent a36dbbf422
commit c3d5a0b8f8
26 changed files with 1519 additions and 624 deletions

View File

@ -261,7 +261,7 @@ func New(bridge *bridge.Bridge, restarter *restarter.Restarter, eventCh <-chan e
return fe
}
func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funlen
func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funlen,gocyclo
// GODT-1949: Better error events.
for _, err := range f.bridge.GetErrors() {
switch {
@ -303,6 +303,9 @@ func (f *frontendCLI) watchEvents(eventCh <-chan events.Event) { // nolint:funle
f.Printf("User %s received a bad event and was logged out.\n", user.Username)
case events.IMAPLoginFailed:
f.Printf("An IMAP login attempt failed for user %v\n", event.Username)
case events.UserAddressUpdated:
user, err := f.bridge.GetUserInfo(event.UserID)
if err != nil {