summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-23 11:54:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-23 11:54:03 (GMT)
commit846c4b9d2e7ec3214a3b13bdbbce77f70fede515 (patch)
tree579bf6be3e266c8e28a7469e7547ac88fa9af3fc /Swift/Controllers/MainController.cpp
parent8ccdfd958ba1e7afbeb8c5893c12f09046cb8892 (diff)
downloadswift-contrib-846c4b9d2e7ec3214a3b13bdbbce77f70fede515.zip
swift-contrib-846c4b9d2e7ec3214a3b13bdbbce77f70fede515.tar.bz2
Allow TLS errors to bubble further up the stackks/tlserrors
Diffstat (limited to 'Swift/Controllers/MainController.cpp')
-rw-r--r--Swift/Controllers/MainController.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index e923cff..b0a1778 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -518,6 +518,7 @@ void MainController::handleDisconnected(const boost::optional<ClientError>& erro
else if (error) {
std::string message;
std::string certificateErrorMessage;
+ bool forceSignout = false;
switch(error->getType()) {
case ClientError::UnknownError: message = QT_TRANSLATE_NOOP("", "Unknown Error"); break;
case ClientError::DomainNameResolveError: message = QT_TRANSLATE_NOOP("", "Unable to find server"); break;
@@ -536,6 +537,7 @@ void MainController::handleDisconnected(const boost::optional<ClientError>& erro
case ClientError::TLSError: message = QT_TRANSLATE_NOOP("", "Encryption error"); break;
case ClientError::ClientCertificateLoadError: message = QT_TRANSLATE_NOOP("", "Error loading certificate (Invalid password?)"); break;
case ClientError::ClientCertificateError: message = QT_TRANSLATE_NOOP("", "Certificate not authorized"); break;
+ case ClientError::CertificateCardRemoved: message = QT_TRANSLATE_NOOP("", "Certificate card removed"); forceSignout = true; break;
case ClientError::UnknownCertificateError: certificateErrorMessage = QT_TRANSLATE_NOOP("", "Unknown certificate"); break;
case ClientError::CertificateExpiredError: certificateErrorMessage = QT_TRANSLATE_NOOP("", "Certificate has expired"); break;
@@ -564,7 +566,7 @@ void MainController::handleDisconnected(const boost::optional<ClientError>& erro
if (forceReconnectAfterCertificateTrust) {
performLoginFromCachedCredentials();
}
- else if (!rosterController_) { //hasn't been logged in yet
+ else if (forceSignout || !rosterController_) { //hasn't been logged in yet or permanent error
signOut();
loginWindow_->setMessage(message);
loginWindow_->setIsLoggingIn(false);