diff options
| author | 2006-07-07 21:40:37 +0000 | |
|---|---|---|
| committer | 2006-07-07 21:40:37 +0000 | |
| commit | 3f50c9807a7dc114697a1309c1752d20c36a0dce (patch) | |
| tree | 4621621e4b9654f435e992502f080b3c18fa37de /src/mode.cpp | |
| parent | Avoid throwing a std::out_of_range exception when given a ban without ! or @ ... (diff) | |
| download | inspircd++-3f50c9807a7dc114697a1309c1752d20c36a0dce.tar.gz inspircd++-3f50c9807a7dc114697a1309c1752d20c36a0dce.tar.bz2 inspircd++-3f50c9807a7dc114697a1309c1752d20c36a0dce.zip | |
Remove the transposition of @ and ! stuff, doesnt work right and not a good enough idea to be worth fixing
Fix mode parser so that if a handler nukes its parameter to an empty string, but its said it MUST have a parameter
(e.g. +b or +L) then thats equivalent to MODEACTION_DENY as we cant do anything without the param. The whole mode
and its parameter get 'eaten' and the next character is moved to instead.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4151 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
| -rw-r--r-- | src/mode.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index e7ee1c3dc..35003de0e 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -496,6 +496,16 @@ void ModeParser::Process(char **parameters, int pcnt, userrec *user, bool server } } ModeAction ma = modehandlers[handler_id]->OnModeChange(user, targetuser, targetchannel, parameter, adding); + + if ((modehandlers[handler_id]->GetNumParams(adding)) && (parameter == "")) + { + /* The handler nuked the parameter and they are supposed to have one. + * We CANT continue now, even if they actually returned MODEACTION_ALLOW, + * so we bail to the next mode character. + */ + continue; + } + if (ma == MODEACTION_ALLOW) { log(DEBUG,"ModeAction was allow"); @@ -598,16 +608,6 @@ void ModeParser::CleanMask(std::string &mask) /* Has a ! but no @, it must be a nick!ident */ mask.append("@*"); } - - /* Check for dumb stuff like *@*!* - * swap the two items over so that at least the n!u@h ordering - * is correct even if the elements may not be - */ - if (((pos_of_pling != std::string::npos) && (pos_of_at != std::string::npos)) && (pos_of_pling > pos_of_at)) - { - mask.replace(pos_of_pling, 1, "@"); - mask.replace(pos_of_at, 1, "!"); - } } bool ModeParser::AddMode(ModeHandler* mh, unsigned const char modeletter) |
