summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-16 20:41:48 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-17 16:33:34 (GMT)
commitf2e3bfbe2ed1b8f35aa958041ee766f9d8ddf31e (patch)
treea6d28ee7ef03dd4538154c29b988e33b01ceb6ed /Swiften/Examples
parentf1c690a5352ee77282bbbd145a3fe0137aceb160 (diff)
downloadswift-contrib-f2e3bfbe2ed1b8f35aa958041ee766f9d8ddf31e.zip
swift-contrib-f2e3bfbe2ed1b8f35aa958041ee766f9d8ddf31e.tar.bz2
Delay IQHandler removal in IQRouter during IQ handling.
Diffstat (limited to 'Swiften/Examples')
-rw-r--r--Swiften/Examples/TuneBot/TuneBot.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Swiften/Examples/TuneBot/TuneBot.cpp b/Swiften/Examples/TuneBot/TuneBot.cpp
index d2bb100..d842798 100644
--- a/Swiften/Examples/TuneBot/TuneBot.cpp
+++ b/Swiften/Examples/TuneBot/TuneBot.cpp
@@ -28,13 +28,13 @@ class TuneBot {
discoResponder_->setDiscoInfo(discoInfo);
discoResponder_->setDiscoInfo(capsInfo_->getNode() + "#" + capsInfo_->getVersion(), discoInfo);
- client_->onSessionStarted.connect(bind(&TuneBot::handleSessionStarted, this));
+ client_->onConnected.connect(bind(&TuneBot::handleSessionStarted, this));
client_->onMessageReceived.connect(bind(&TuneBot::handleMessage, this, _1));
client_->connect();
}
void handleSessionStarted() {
- GetRosterRequest* rosterRequest = new GetRosterRequest(router_, Request::AutoDeleteAfterResponse);
+ boost::shared_ptr<GetRosterRequest> rosterRequest(new GetRosterRequest(router_));
rosterRequest->onResponse.connect(bind(&TuneBot::handleRosterReceived, this, _1));
rosterRequest->send();
}
@@ -43,7 +43,7 @@ class TuneBot {
boost::shared_ptr<Presence> presence(new Presence());
presence->addPayload(capsInfo_);
presence->setPriority(-1);
- client_->send(presence);
+ client_->sendPresence(presence);
}
void handleMessage(shared_ptr<Message> message) {
@@ -58,8 +58,7 @@ class TuneBot {
};
-int main(int argc, char* argv[])
-{
+int main(int argc, char* argv[]) {
if (argc != 3) {
std::cerr << "Usage: " << argv[0] << " <jid> <password>" << std::endl;
return -1;
@@ -67,6 +66,6 @@ int main(int argc, char* argv[])
SimpleEventLoop eventLoop;
- TuneBot bot(argv[1], argv[2]);
+ TuneBot bot(JID(argv[1]), argv[2]);
eventLoop.run();
}