summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-01 19:24:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-01 19:24:53 +0000
commit9941be7564b61343923129a2021309cfe04225e0 (patch)
tree5b0d6f250b274278410d5cb2fc6af7f8e2a2d915 /src/inspircd.cpp
parente0c54b23f69bed4df36348a2f88edaea6e1f96d4 (diff)
Added clever code to propogate module's special commands (SAJOIN, KNOCK etc) transparently!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2084 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index a946abbbb..2e300df95 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -1560,6 +1560,27 @@ void handle_version(char **parameters, int pcnt, userrec *user)
}
+bool is_valid_cmd(const char* commandname, int pcnt, userrec * user)
+{
+ for (unsigned int i = 0; i < cmdlist.size(); i++)
+ {
+ if (!strcasecmp(cmdlist[i].command,commandname))
+ {
+ if (cmdlist[i].handler_function)
+ {
+ if (pcnt>=cmdlist[i].min_params)
+ {
+ if (strchr(user->modes,cmdlist[i].flags_needed))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
+
// calls a handler function for a command
void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user)