Add OnJoining module hook.

This patch adds an OnJoining module hook that allows a module to allow
or disallow joining any given channel.
This commit is contained in:
Alexander Færøy
2014-05-29 17:56:04 +02:00
parent 5d001cd0e0
commit db0e0995e2
9 changed files with 22 additions and 0 deletions

View File

@@ -762,6 +762,12 @@ void CIRCNetwork::JoinChans(set<CChan*>& sChans) {
}
bool CIRCNetwork::JoinChan(CChan* pChan) {
bool bReturn = false;
NETWORKMODULECALL(OnJoining(*pChan), m_pUser, this, NULL, &bReturn);
if (bReturn)
return false;
if (m_pUser->JoinTries() != 0 && pChan->GetJoinTries() >= m_pUser->JoinTries()) {
PutStatus("The channel " + pChan->GetName() + " could not be joined, disabling it.");
pChan->Disable();