mirror of
https://github.com/znc/znc.git
synced 2026-08-03 23:43:42 +02:00
Remove OnRehashDone and add OnPre/PostRehash
This patch is from SilverLeo. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1046 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+4
-2
@@ -482,7 +482,8 @@ CString CModule::GetModNick() const { return ((m_pUser) ? m_pUser->GetStatusPref
|
||||
|
||||
bool CModule::OnLoad(const CString& sArgs, CString& sMessage) { sMessage = ""; return true; }
|
||||
bool CModule::OnBoot() { return true; }
|
||||
void CModule::OnRehashDone() {}
|
||||
void CModule::OnPreRehash() {}
|
||||
void CModule::OnPostRehash() {}
|
||||
void CModule::OnIRCDisconnected() {}
|
||||
void CModule::OnIRCConnected() {}
|
||||
CModule::EModRet CModule::OnBroadcast(CString& sMessage) { return CONTINUE; }
|
||||
@@ -590,7 +591,8 @@ bool CModules::OnBoot() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CModules::OnRehashDone() { MODUNLOADCHK(OnRehashDone()); return false; }
|
||||
bool CModules::OnPreRehash() { MODUNLOADCHK(OnPreRehash()); return false; }
|
||||
bool CModules::OnPostRehash() { MODUNLOADCHK(OnPostRehash()); return false; }
|
||||
bool CModules::OnIRCConnected() { MODUNLOADCHK(OnIRCConnected()); return false; }
|
||||
bool CModules::OnBroadcast(CString& sMessage) { MODHALTCHK(OnBroadcast(sMessage)); }
|
||||
bool CModules::OnIRCDisconnected() { MODUNLOADCHK(OnIRCDisconnected()); return false; }
|
||||
|
||||
@@ -225,7 +225,8 @@ public:
|
||||
|
||||
virtual bool OnLoad(const CString& sArgsi, CString& sMessage);
|
||||
virtual bool OnBoot();
|
||||
virtual void OnRehashDone();
|
||||
virtual void OnPreRehash();
|
||||
virtual void OnPostRehash();
|
||||
virtual void OnIRCDisconnected();
|
||||
virtual void OnIRCConnected();
|
||||
virtual EModRet OnBroadcast(CString& sMessage);
|
||||
@@ -361,7 +362,8 @@ public:
|
||||
void UnloadAll();
|
||||
|
||||
virtual bool OnBoot(); // Return false to abort
|
||||
virtual bool OnRehashDone();
|
||||
virtual bool OnPreRehash();
|
||||
virtual bool OnPostRehash();
|
||||
virtual bool OnIRCDisconnected();
|
||||
virtual bool OnIRCConnected();
|
||||
virtual bool OnBroadcast(CString& sMessage);
|
||||
|
||||
@@ -855,6 +855,14 @@ bool CZNC::ParseConfig(const CString& sConfig)
|
||||
|
||||
bool CZNC::RehashConfig(CString& sError)
|
||||
{
|
||||
#ifdef _MODULES
|
||||
GetModules().OnPreRehash();
|
||||
for (map<CString, CUser*>::iterator itb = m_msUsers.begin();
|
||||
itb != m_msUsers.end(); itb++) {
|
||||
itb->second->GetModules().OnPreRehash();
|
||||
}
|
||||
#endif
|
||||
|
||||
// This clears m_msDelUsers
|
||||
HandleUserDeletion();
|
||||
|
||||
@@ -864,10 +872,10 @@ bool CZNC::RehashConfig(CString& sError)
|
||||
|
||||
if (DoRehash(sError)) {
|
||||
#ifdef _MODULES
|
||||
GetModules().OnRehashDone();
|
||||
GetModules().OnPostRehash();
|
||||
for (map<CString, CUser*>::iterator it = m_msUsers.begin();
|
||||
it != m_msUsers.end(); it++) {
|
||||
it->second->GetModules().OnRehashDone();
|
||||
it->second->GetModules().OnPostRehash();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user