mirror of
https://github.com/znc/znc.git
synced 2026-07-05 17:31:06 +02:00
Add new macro ALLMODULECALL()
This macro does a module call on all global and all user modules on all users. This is useful for e.g. OnBoot(). git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2075 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -28,6 +28,24 @@
|
||||
#define _DATADIR_ "/usr/share/znc"
|
||||
#endif
|
||||
|
||||
#define ALLMODULECALL(macFUNC, macEXITER) \
|
||||
do { \
|
||||
CGlobalModules& GMods = CZNC::Get().GetModules(); \
|
||||
if (GMods.macFUNC) { \
|
||||
macEXITER; \
|
||||
} else { \
|
||||
const map<CString, CUser*>& mUsers = \
|
||||
CZNC::Get().GetUserMap(); \
|
||||
map<CString, CUser*>::const_iterator it; \
|
||||
for (it = mUsers.begin(); it != mUsers.end(); ++it) { \
|
||||
CModules& UMods = it->second->GetModules(); \
|
||||
if (UMods.macFUNC) { \
|
||||
macEXITER; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
#define GLOBALMODULECALL(macFUNC, macUSER, macCLIENT, macEXITER) \
|
||||
do { \
|
||||
CGlobalModules& GMods = CZNC::Get().GetModules(); \
|
||||
|
||||
Reference in New Issue
Block a user