summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 23:14:18 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-27 23:14:18 +0000
commit12fc9198eeaea7666ad65cf64fd204d038a54e4e (patch)
tree42da4fd4bfb332eea1cfc1f824ba1fdc46af6529 /src
parentb4175f4f09ffc04cd720df62789f043c9182b099 (diff)
Tidy this up a bit (it looked weird :P)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7926 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index d38a6bbca..6ba4758bd 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -249,20 +249,29 @@ CmdResult CommandParser::CallHandler(const std::string &commandname,const char**
{
if (pcnt >= n->second->min_params)
{
- if ((!n->second->flags_needed) || (user->IsModeSet(n->second->flags_needed)))
+ bool bOkay = false;
+
+ if (IS_LOCAL(user) && n->second->flags_needed)
{
- if (n->second->flags_needed)
- {
- if (IS_REMOTE(user) || user->HasPermission(commandname))
- {
- return n->second->Handle(parameters,pcnt,user);
- }
- }
- else
+ /* if user is local, and flags are needed .. */
+
+ if (user->IsModeSet(n->second->flags_needed))
{
- return n->second->Handle(parameters,pcnt,user);
+ /* if user has the flags, and now has the permissions, go ahead */
+ if (user->HasPermission(commandname))
+ bOkay = true;
}
}
+ else
+ {
+ /* remote or no flags required anyway */
+ bOkay = true;
+ }
+
+ if (bOkay)
+ {
+ return n->second->Handle(parameters,pcnt,user);
+ }
}
}
return CMD_INVALID;