summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-12 14:32:25 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-12 14:41:37 (GMT)
commit6578b5872440f63ed8a4903bae83e46e936d469e (patch)
treea453197b52a5690adc2af2c842705c0aa3b9737c /Swift/Controllers
parentb207ccba601f36aa254e2af5c202ed492a78feb6 (diff)
downloadswift-6578b5872440f63ed8a4903bae83e46e936d469e.zip
swift-6578b5872440f63ed8a4903bae83e46e936d469e.tar.bz2
Auto-reconnect after disconnection
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp12
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();
}
}