summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-08-28 09:19:46 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-08-28 09:19:46 (GMT)
commit5f1cb0d768265347bc80862c33f5967f07759b10 (patch)
tree979eceddcd0f5e6a651180b91d0908e1e1e319b7 /Swiften/Disco/UnitTest
parent8dbae452004e7bc3c3a6e855f365b9bb348e8f2d (diff)
downloadswift-contrib-5f1cb0d768265347bc80862c33f5967f07759b10.zip
swift-contrib-5f1cb0d768265347bc80862c33f5967f07759b10.tar.bz2
Check sender on incoming IQ responses.
Release-Notes: Fixed a bug whereby the sender of an iq wasn't being checked before matching it to a request.
Diffstat (limited to 'Swiften/Disco/UnitTest')
-rw-r--r--Swiften/Disco/UnitTest/CapsManagerTest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Disco/UnitTest/CapsManagerTest.cpp b/Swiften/Disco/UnitTest/CapsManagerTest.cpp
index d5b9896..3d69338 100644
--- a/Swiften/Disco/UnitTest/CapsManagerTest.cpp
+++ b/Swiften/Disco/UnitTest/CapsManagerTest.cpp
@@ -124,7 +124,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
void testReceiveSameHashFromDifferentUserAfterFailedDiscoRequestsDisco() {
std::auto_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
- stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
+ stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
stanzaChannel->sentStanzas.clear();
sendPresenceWithCaps(user2, capsInfo1);
@@ -175,7 +175,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
std::auto_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
sendPresenceWithCaps(user2, capsInfo1alt);
- stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
+ stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex<DiscoInfo>(1, user2, IQ::Get));
boost::shared_ptr<DiscoInfo> discoInfo(stanzaChannel->sentStanzas[1]->getPayload<DiscoInfo>());
@@ -188,8 +188,8 @@ class CapsManagerTest : public CppUnit::TestFixture {
sendPresenceWithCaps(user1, capsInfo1);
sendPresenceWithCaps(user2, capsInfo1alt);
sendPresenceWithCaps(user3, capsInfo1);
- stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
- stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[1]->getID()));
+ stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
+ stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[1]->getTo(), stanzaChannel->sentStanzas[1]->getID()));
CPPUNIT_ASSERT(stanzaChannel->isRequestAtIndex<DiscoInfo>(2, user3, IQ::Get));
}
@@ -197,7 +197,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
void testReceiveSameHashFromFailingUserAfterReconnectRequestsDisco() {
std::auto_ptr<CapsManager> testling = createManager();
sendPresenceWithCaps(user1, capsInfo1);
- stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
+ stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
stanzaChannel->setAvailable(false);
stanzaChannel->setAvailable(true);
stanzaChannel->sentStanzas.clear();
@@ -215,7 +215,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
stanzaChannel->setAvailable(true);
stanzaChannel->sentStanzas.clear();
sendPresenceWithCaps(user1, capsInfo1);
- stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getID()));
+ stanzaChannel->onIQReceived(IQ::createError(JID("baz@fum.com/foo"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID()));
CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(stanzaChannel->sentStanzas.size()));
}
@@ -251,7 +251,7 @@ class CapsManagerTest : public CppUnit::TestFixture {
}
void sendDiscoInfoResult(boost::shared_ptr<DiscoInfo> discoInfo) {
- stanzaChannel->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[0]->getID(), discoInfo));
+ stanzaChannel->onIQReceived(IQ::createResult(JID("baz@fum.com/dum"), stanzaChannel->sentStanzas[0]->getTo(), stanzaChannel->sentStanzas[0]->getID(), discoInfo));
}
private: