mirror of
https://github.com/znc/znc.git
synced 2026-06-12 17:54:59 +02:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user