]> jfr.im git - irc/rizon/znc.git/commitdiff
Improve both, the code's and the debug output's easy-to-readyiness
authorpsychon <redacted>
Fri, 12 Sep 2008 15:41:12 +0000 (15:41 +0000)
committerpsychon <redacted>
Fri, 12 Sep 2008 15:41:12 +0000 (15:41 +0000)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1198 726aef4b-f618-498e-8847-2d620e286838

znc.cpp

diff --git a/znc.cpp b/znc.cpp
index 23e059dd366d40d53c3df8f2e680172a5cfede0a..3a1a7f92c3123baaa8dd67c6af5f5b08b1d744fb 100644 (file)
--- 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) {