mirror of
https://github.com/znc/znc.git
synced 2026-05-04 04:22:37 +02:00
Split up CUser::JoinChans()
This adds CUser::JoinChan() as a helper function git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1601 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
31
User.cpp
31
User.cpp
@@ -708,23 +708,30 @@ void CUser::JoinChans() {
|
||||
for (unsigned int a = 0; a < m_vChans.size(); a++) {
|
||||
CChan* pChan = m_vChans[a];
|
||||
if (!pChan->IsOn() && !pChan->IsDisabled()) {
|
||||
if (JoinTries() != 0 && pChan->GetJoinTries() >= JoinTries()) {
|
||||
PutStatus("The channel " + pChan->GetName() + " could not be joined, disabling it.");
|
||||
pChan->Disable();
|
||||
} else {
|
||||
pChan->IncJoinTries();
|
||||
MODULECALL(OnTimerAutoJoin(*pChan), this, NULL, continue);
|
||||
if (!JoinChan(pChan))
|
||||
continue;
|
||||
|
||||
PutIRC("JOIN " + pChan->GetName() + " " + pChan->GetKey());
|
||||
|
||||
// Limit the number of joins
|
||||
if (uJoins != 0 && --uJoins == 0)
|
||||
return;
|
||||
}
|
||||
// Limit the number of joins
|
||||
if (uJoins != 0 && --uJoins == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CUser::JoinChan(CChan* pChan) {
|
||||
if (JoinTries() != 0 && pChan->GetJoinTries() >= JoinTries()) {
|
||||
PutStatus("The channel " + pChan->GetName() + " could not be joined, disabling it.");
|
||||
pChan->Disable();
|
||||
} else {
|
||||
pChan->IncJoinTries();
|
||||
MODULECALL(OnTimerAutoJoin(*pChan), this, NULL, return false);
|
||||
|
||||
PutIRC("JOIN " + pChan->GetName() + " " + pChan->GetKey());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CServer* CUser::FindServer(const CString& sName) const {
|
||||
for (unsigned int a = 0; a < m_vServers.size(); a++) {
|
||||
CServer* pServer = m_vServers[a];
|
||||
|
||||
Reference in New Issue
Block a user