Allow the connection queue to be paused

This commit is contained in:
Kyle Fuller
2012-02-10 01:33:44 +00:00
parent ec1202daf3
commit e47f76db6c
2 changed files with 17 additions and 1 deletions
+13 -1
View File
@@ -1868,7 +1868,7 @@ void CZNC::SetConnectDelay(unsigned int i) {
}
void CZNC::EnableConnectQueue() {
if (!m_pConnectQueueTimer) {
if (!m_pConnectQueueTimer && !m_uiConnectPaused && !m_lpConnectQueue.empty()) {
m_pConnectQueueTimer = new CConnectQueueTimer(m_uiConnectDelay);
GetManager().AddCron(m_pConnectQueueTimer);
}
@@ -1882,6 +1882,18 @@ void CZNC::DisableConnectQueue() {
}
}
void CZNC::PauseConnectQueue() {
DEBUG("Connection queue paused");
m_uiConnectPaused++;
DisableConnectQueue();
}
void CZNC::ResumeConnectQueue() {
DEBUG("Connection queue resumed");
m_uiConnectPaused--;
EnableConnectQueue();
}
void CZNC::AddNetworkToQueue(CIRCNetwork *pNetwork) {
// Make sure we are not already in the queue
for (list<CIRCNetwork*>::const_iterator it = m_lpConnectQueue.begin(); it != m_lpConnectQueue.end(); ++it) {