diff options
author | Kevin Smith <git@kismith.co.uk> | 2009-09-16 09:47:42 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2009-09-16 09:47:42 (GMT) |
commit | 5d71183270c1b214a816e494ab7de9d94502df33 (patch) | |
tree | b5cbf5ff34a6f1cd03a673ad3adb956db7a6f438 /Swift/Controllers/MainController.cpp | |
parent | 9a02397822d7ef3dea95bc8821f14fb35d201b7b (diff) | |
download | swift-contrib-5d71183270c1b214a816e494ab7de9d94502df33.zip swift-contrib-5d71183270c1b214a816e494ab7de9d94502df33.tar.bz2 |
SignOut nearly working.
Diffstat (limited to 'Swift/Controllers/MainController.cpp')
-rw-r--r-- | Swift/Controllers/MainController.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 63c854f..958a2ed 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -135,6 +135,7 @@ void MainController::handleConnected() { rosterController_->onStartChatRequest.connect(boost::bind(&MainController::handleChatRequest, this, _1)); rosterController_->onJoinMUCRequest.connect(boost::bind(&MainController::handleJoinMUCRequest, this, _1, _2)); rosterController_->onChangeStatusRequest.connect(boost::bind(&MainController::handleChangeStatusRequest, this, _1, _2)); + rosterController_->onSignOutRequest.connect(boost::bind(&MainController::signOut, this)); xmppRosterController_ = new XMPPRosterController(client_, xmppRoster_); xmppRosterController_->requestRoster(); @@ -262,7 +263,8 @@ void MainController::handleError(const ClientError& error) { logout(); } -void MainController::signout() { +void MainController::signOut() { + logout(); loginWindow_->loggedOut(); foreach (JIDChatControllerPair controllerPair, chatControllers_) { delete controllerPair.second; @@ -278,6 +280,9 @@ void MainController::signout() { } void MainController::logout() { + if (client_->isAvailable()) { + client_->disconnect(); + } setManagersEnabled(false); } |