summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-10 13:31:39 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-10 13:31:39 (GMT)
commit29e4e51e21b8902c82456cc85af46fa5f5889f04 (patch)
tree5ad1d62b82effb59d46d92a272b3ebe998ce6e08 /Swiften/Queries/Responders
parentfb7fe3dd7cf48b0e4a7337212129520dff5a236d (diff)
downloadswift-contrib-29e4e51e21b8902c82456cc85af46fa5f5889f04.zip
swift-contrib-29e4e51e21b8902c82456cc85af46fa5f5889f04.tar.bz2
Refactor responders to only start on start().
Diffstat (limited to 'Swiften/Queries/Responders')
-rw-r--r--Swiften/Queries/Responders/RosterPushResponder.h2
-rw-r--r--Swiften/Queries/Responders/UnitTest/DiscoInfoResponderTest.cpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/Swiften/Queries/Responders/RosterPushResponder.h b/Swiften/Queries/Responders/RosterPushResponder.h
index 8c57fd3..48111a7 100644
--- a/Swiften/Queries/Responders/RosterPushResponder.h
+++ b/Swiften/Queries/Responders/RosterPushResponder.h
@@ -22,7 +22,7 @@ namespace Swift {
private:
virtual bool handleSetRequest(const JID& from, const String& id, boost::shared_ptr<RosterPayload> payload) {
onRosterReceived(payload);
- sendResponse(from, id, boost::shared_ptr<Payload>());
+ sendResponse(from, id, boost::shared_ptr<RosterPayload>());
return true;
}
};
diff --git a/Swiften/Queries/Responders/UnitTest/DiscoInfoResponderTest.cpp b/Swiften/Queries/Responders/UnitTest/DiscoInfoResponderTest.cpp
index 62d9aca..20fa9ff 100644
--- a/Swiften/Queries/Responders/UnitTest/DiscoInfoResponderTest.cpp
+++ b/Swiften/Queries/Responders/UnitTest/DiscoInfoResponderTest.cpp
@@ -35,7 +35,8 @@ class DiscoInfoResponderTest : public CppUnit::TestFixture {
}
void testHandleRequest_GetToplevelInfo() {
- DiscoInfoResponder testling(router_);
+ DiscoInfoResponder testling(router_);
+ testling.start();
DiscoInfo discoInfo;
discoInfo.addFeature("foo");
testling.setDiscoInfo(discoInfo);
@@ -48,10 +49,13 @@ class DiscoInfoResponderTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT_EQUAL(String(""), payload->getNode());
CPPUNIT_ASSERT(payload->hasFeature("foo"));
+
+ testling.stop();
}
void testHandleRequest_GetNodeInfo() {
DiscoInfoResponder testling(router_);
+ testling.start();
DiscoInfo discoInfo;
discoInfo.addFeature("foo");
testling.setDiscoInfo(discoInfo);
@@ -68,6 +72,8 @@ class DiscoInfoResponderTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT(payload);
CPPUNIT_ASSERT_EQUAL(String("bar-node"), payload->getNode());
CPPUNIT_ASSERT(payload->hasFeature("bar"));
+
+ testling.stop();
}
void testHandleRequest_GetInvalidNodeInfo() {