feat(GODT-2621): display pop up warning when IMAP login fails because user is locked (connecting).

This commit is contained in:
Xavier Michelon
2023-05-10 14:40:41 +02:00
committed by Romain Le Jeune
parent 51288791c0
commit 6ba8052a1e
2 changed files with 11 additions and 0 deletions

View File

@ -1019,6 +1019,16 @@ void QMLBackend::onIMAPLoginFailed(QString const &username) {
tr("Your email client can't connect to Proton Bridge. Make sure you are using the local Bridge password shown in Bridge."));
break;
case UserState::Locked:
if (user->isNotificationInCooldown(User::ENotification::IMAPLoginWhileLocked)) {
return;
}
user->startNotificationCooldownPeriod(User::ENotification::IMAPLoginWhileLocked, cooldownDurationMs);
emit selectUser(user->id(), false);
trayIcon_->showErrorPopupNotification(tr("Connection in progress"),
tr("Your Proton account in Bridge is being connected. Please wait or restart Bridge."));
break;
default:
break;
}

View File

@ -66,6 +66,7 @@ public: // data types
enum class ENotification {
IMAPLoginWhileSignedOut, ///< An IMAP client tried to login while the user is signed out.
IMAPPasswordFailure, ///< An IMAP client provided an invalid password for the user.
IMAPLoginWhileLocked, ///< An IMAP client tried to connect while the user is locked.
};
public: // static member function