diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-28 20:07:57 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-28 20:16:52 (GMT) |
| commit | 5c2567847c73f6095206dfbd451fe2f26f4056aa (patch) | |
| tree | 06a9ed263bec86531bd08b89242c78b3aeb0d8a0 /Swift/Controllers/MainController.cpp | |
| parent | 85dcc894ccf417ec8b057d868afb1d8006634ac4 (diff) | |
| download | swift-5c2567847c73f6095206dfbd451fe2f26f4056aa.zip swift-5c2567847c73f6095206dfbd451fe2f26f4056aa.tar.bz2 | |
Implemented XML console.
Resolves: #135
Diffstat (limited to 'Swift/Controllers/MainController.cpp')
| -rw-r--r-- | Swift/Controllers/MainController.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 2e640e0..8800da0 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -42,22 +42,12 @@ #include "Swiften/Queries/Requests/GetVCardRequest.h" #include "Swiften/Avatars/AvatarFileStorage.h" #include "Swiften/Avatars/AvatarManager.h" #include "Swiften/StringCodecs/SHA1.h" #include "Swiften/StringCodecs/Hexify.h" -namespace { - void printIncomingData(const Swift::String& data) { - std::cout << "<- " << data << std::endl; - } - - void printOutgoingData(const Swift::String& data) { - std::cout << "-> " << data << std::endl; - } -} - namespace Swift { static const String CLIENT_NAME = "Swift"; static const String CLIENT_VERSION = "0.3"; static const String CLIENT_NODE = "http://swift.im"; @@ -270,14 +260,16 @@ void MainController::handleLoginRequest(const String &username, const String &pa } void MainController::performLoginFromCachedCredentials() { if (!client_) { client_ = new Swift::Client(jid_, password_); presenceSender_ = new PresenceSender(client_); - //client_->onDataRead.connect(&printIncomingData); - //client_->onDataWritten.connect(&printOutgoingData); + client_->onDataRead.connect(boost::bind( + &XMLConsoleController::handleDataRead, xmlConsoleController_, _1)); + client_->onDataWritten.connect(boost::bind( + &XMLConsoleController::handleDataWritten, xmlConsoleController_, _1)); if (!certificateFile_.isEmpty()) { client_->setCertificate(certificateFile_); } client_->onError.connect(boost::bind(&MainController::handleError, this, _1)); client_->onConnected.connect(boost::bind(&MainController::handleConnected, this)); client_->onMessageReceived.connect(boost::bind(&MainController::handleIncomingMessage, this, _1)); |
Swift