diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-04-12 14:32:25 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-04-12 14:41:37 (GMT) |
commit | 6578b5872440f63ed8a4903bae83e46e936d469e (patch) | |
tree | a453197b52a5690adc2af2c842705c0aa3b9737c | |
parent | b207ccba601f36aa254e2af5c202ed492a78feb6 (diff) | |
download | swift-contrib-6578b5872440f63ed8a4903bae83e46e936d469e.zip swift-contrib-6578b5872440f63ed8a4903bae83e46e936d469e.tar.bz2 |
Auto-reconnect after disconnection
-rw-r--r-- | Swift/Controllers/MainController.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index e20e9f8..33928f8 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -234,7 +234,7 @@ void MainController::handleEventQueueLengthChange(int count) { void MainController::reconnectAfterError() { performLoginFromCachedCredentials(); - sendPresence(queuedPresence_); + //sendPresence(queuedPresence_); } void MainController::handleChangeStatusRequest(StatusShow::Type show, const String &statusText) { @@ -353,13 +353,15 @@ void MainController::handleError(const ClientError& error) { signOut(); loginWindow_->setMessage(message); } else { - message = "Disconnected from " + jid_.getDomain() + ": "; - lastDisconnectError_ = boost::shared_ptr<ErrorEvent>(new ErrorEvent(JID(jid_.getDomain()), message)); - eventController_->handleIncomingEvent(lastDisconnectError_); + if (!lastDisconnectError_) { + message = "Disconnected from " + jid_.getDomain() + ": "; + lastDisconnectError_ = boost::shared_ptr<ErrorEvent>(new ErrorEvent(JID(jid_.getDomain()), message)); + eventController_->handleIncomingEvent(lastDisconnectError_); + } } logout(); if (rosterController_) { - //reconnectAfterError(); + reconnectAfterError(); } } |