mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01: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