bool CIRCNetwork::Connect() { if (!GetIRCConnectEnabled() || m_pIRCSock || !HasServers()) return false; CServer *pServer = GetNextServer(); if (!pServer) return false; if (CZNC::Get().GetServerThrottle(pServer->GetName())) { CZNC::Get().AddNetworkToQueue(this); return false; } CZNC::Get().AddServerThrottle(pServer->GetName()); bool bSSL = pServer->IsSSL(); #ifndef HAVE_LIBSSL if (bSSL) { PutStatus("Cannot connect to [" + pServer->GetString(false) + "], ZNC is not compiled with SSL."); CZNC::Get().AddNetworkToQueue(this); return false; } #endif CIRCSock *pIRCSock = new CIRCSock(this); pIRCSock->SetPass(pServer->GetPass()); DEBUG("Connecting user/network [" << m_pUser->GetUserName() << "/" << m_sName << "]"); NETWORKMODULECALL(OnIRCConnecting(pIRCSock), m_pUser, this, NULL, DEBUG("Some module aborted the connection attempt"); PutStatus("Some module aborted the connection attempt"); delete pIRCSock; CZNC::Get().AddNetworkToQueue(this); return false; );
bool CModules::OnIRCConnecting(CIRCSock *pIRCSock) { MODHALTCHK(OnIRCConnecting(pIRCSock)); }