From 87a368cb646ca6949b76bed969c48e573720066e Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 12 Sep 2008 15:41:12 +0000 Subject: [PATCH] Improve both, the code's and the debug output's easy-to-readyiness git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1198 726aef4b-f618-498e-8847-2d620e286838 --- znc.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/znc.cpp b/znc.cpp index 23e059dd..3a1a7f92 100644 --- a/znc.cpp +++ b/znc.cpp @@ -1753,18 +1753,27 @@ protected: it++; m_uiPosNextUser = (m_uiPosNextUser + 1) % uiUserCount; - // Is this user disconnected and does he want to connect? - if (pUser->GetIRCSock() == NULL && pUser->GetIRCConnectEnabled()) { - // The timer runs until it once didn't find any users to connect - bUsersLeft = true; + // Is this user disconnected? + if (pUser->GetIRCSock() != NULL) + continue; - DEBUG_ONLY(cout << "Connecting user [" << pUser->GetUserName() - << "]" << endl); + // Does this user want to connect? + if (!pUser->GetIRCConnectEnabled()) + continue; - if (CZNC::Get().ConnectUser(pUser)) - // User connecting, wait until next time timer fires - return; - } + // Does this user have any servers? + if (!pUser->HasServers()) + continue; + + // The timer runs until it once didn't find any users to connect + bUsersLeft = true; + + DEBUG_ONLY(cout << "Connecting user [" << pUser->GetUserName() + << "]" << endl); + + if (CZNC::Get().ConnectUser(pUser)) + // User connecting, wait until next time timer fires + return; } if (bUsersLeft == false) {