summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-14 18:30:44 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-14 18:30:44 +0000
commitc8f3a8d365aeb89455c391efff190ffb48b05a2c (patch)
tree12d11c0b558024e55d426830e92ecee667a69e66 /src
parent8c14f0f530c61fd4875131902937fba9f780adf7 (diff)
Fix BeforeMode to have the parameter available, if there are enough parameters for the mode and the mode parameter is valid
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6326 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 4d6023c1c..695f043da 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -435,12 +435,7 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
{
bool abort = false;
- for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
- {
- if ((*watchers)->BeforeMode(user, targetuser, targetchannel, parameter, adding, type) == MODEACTION_DENY)
- abort = true;
- }
- if ((modehandlers[handler_id]->GetModeType() == type) && (!abort))
+ if (modehandlers[handler_id]->GetModeType() == type)
{
if (modehandlers[handler_id]->GetNumParams(adding))
{
@@ -459,6 +454,18 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
/* No parameter, continue to the next mode */
continue;
}
+
+ for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
+ {
+ if ((*watchers)->BeforeMode(user, targetuser, targetchannel, parameter, adding, type) == MODEACTION_DENY)
+ {
+ abort = true;
+ break;
+ }
+ }
+
+ if (abort)
+ continue;
}
/* It's an oper only mode, check if theyre an oper. If they arent,