From 9f1a88bec8efe64f4689498047170c1f8ef9f455 Mon Sep 17 00:00:00 2001 From: HanzZ Date: Sun, 16 Sep 2012 14:56:07 +0200 Subject: [PATCH] Working reconnection --- src/tests/user.cpp | 2 ++ src/user.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/tests/user.cpp b/src/tests/user.cpp index fcf348c8..114da87b 100644 --- a/src/tests/user.cpp +++ b/src/tests/user.cpp @@ -205,6 +205,7 @@ class UserTest : public CPPUNIT_NS :: TestFixture, public BasicTest { } void handleDisconnectedReconnect() { + readyToConnect = false; User *user = userManager->getUser("user@localhost"); user->handleDisconnected("Connection error"); loop->processEvents(); @@ -212,6 +213,7 @@ class UserTest : public CPPUNIT_NS :: TestFixture, public BasicTest { CPPUNIT_ASSERT(!streamEnded); user = userManager->getUser("user@localhost"); CPPUNIT_ASSERT(user); + CPPUNIT_ASSERT(readyToConnect); } }; diff --git a/src/user.cpp b/src/user.cpp index 3d3cb06d..56f53f72 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -348,6 +348,7 @@ void User::handleDisconnected(const std::string &error, Swift::SpectrumErrorPayl // TODO: If this stops working, create onReconnect signal m_userManager->onUserDestroyed(this); m_userManager->onUserCreated(this); + onReadyToConnect(); return; } }