diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:44:24 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:44:24 +0000 |
commit | e27f3380733a4412007a3f023069615d1218ab96 (patch) | |
tree | b5d9f56ff1a40c430e8fe87b50596b414ec44af4 /src/channels.cpp | |
parent | 5abd3b1cc5fba26486d71c6a415fae797388ddf3 (diff) |
Replace FOREACH_RESULT_MAP with a more readable and flexible do_each_hook/while_each_hook macro pair
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11598 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 6e0f4c686..532953db3 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -475,9 +475,11 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const bool Channel::IsBanned(User* user) { int result = 0; - FOREACH_RESULT_MAP(I_OnCheckBan, OnCheckBan(user, this), - result = banmatch_reduce(result, MOD_RESULT); - ); + DO_EACH_HOOK(ServerInstance, OnCheckBan, int modresult, (user, this)) + { + result = banmatch_reduce(result, modresult); + } + WHILE_EACH_HOOK(ServerInstance, OnCheckBan); if (result) return (result < 0); @@ -499,9 +501,11 @@ bool Channel::IsBanned(User* user) int Channel::GetExtBanStatus(const std::string &str, char type) { int result = 0; - FOREACH_RESULT_MAP(I_OnCheckStringExtBan, OnCheckStringExtBan(str, this, type), - result = banmatch_reduce(result, MOD_RESULT); - ); + DO_EACH_HOOK(ServerInstance, OnCheckStringExtBan, int modresult, (str, this, type)) + { + result = banmatch_reduce(result, modresult); + } + WHILE_EACH_HOOK(ServerInstance, OnCheckStringExtBan); if (result) return result; @@ -525,9 +529,11 @@ int Channel::GetExtBanStatus(const std::string &str, char type) int Channel::GetExtBanStatus(User *user, char type) { int result = 0; - FOREACH_RESULT_MAP(I_OnCheckExtBan, OnCheckExtBan(user, this, type), - result = banmatch_reduce(result, MOD_RESULT); - ); + DO_EACH_HOOK(ServerInstance, OnCheckExtBan, int modresult, (user, this, type)) + { + result = banmatch_reduce(result, modresult); + } + WHILE_EACH_HOOK(ServerInstance, OnCheckExtBan); if (result) return result; |