diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mode.cpp | 15 | ||||
-rw-r--r-- | src/modules.cpp | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 3406393cf..e3929e392 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -306,6 +306,11 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser { unsigned char mletter = *mode; + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnRawMode, OnRawMode(user, targetchannel, *mode, "", true, 0)); + if (MOD_RESULT == ACR_DENY) + continue; + if (*mode == '+') { mode++; @@ -501,6 +506,11 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser continue; } + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnRawMode, OnRawMode(user, targetchannel, modechar, parameter, adding, 1)); + if (MOD_RESULT == ACR_DENY) + return; + bool had_parameter = !parameter.empty(); for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) @@ -523,6 +533,11 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser } else { + int MOD_RESULT = 0; + FOREACH_RESULT(I_OnRawMode, OnRawMode(user, targetchannel, modechar, "", adding, 0)); + if (MOD_RESULT == ACR_DENY) + return; + /* Fix by brain: mode watchers not being called for parameterless modes */ for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) { diff --git a/src/modules.cpp b/src/modules.cpp index 36f0eb2e5..2233c985d 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -140,7 +140,7 @@ bool Module::OnCheckReady(User*) { return true; } int Module::OnUserRegister(User*) { return 0; } int Module::OnUserPreKick(User*, User*, Channel*, const std::string&) { return 0; } void Module::OnUserKick(User*, User*, Channel*, const std::string&, bool&) { } -int Module::OnRawMode(User*, Channel*, char, const std::string &, bool, int) { return 0; } +int Module::OnRawMode(User*, Channel*, const char, const std::string &, bool, int) { return 0; } int Module::OnCheckInvite(User*, Channel*) { return 0; } int Module::OnCheckKey(User*, Channel*, const std::string&) { return 0; } int Module::OnCheckLimit(User*, Channel*) { return 0; } |