ignore funcmd's in cmd_commands and disallow channel comprehensive fun commands
authorpk910 <philipp@zoelle1.de>
Tue, 1 Nov 2011 23:08:20 +0000 (00:08 +0100)
committerpk910 <philipp@zoelle1.de>
Tue, 1 Nov 2011 23:08:20 +0000 (00:08 +0100)
src/cmd_global_commands.c
src/modcmd.c

index 53f90bd4d96f2bd2dcdc358f61fb4edde1cf76b7..0b6d16c00dd9d29d965b9b6f5cdf047747c5c47e 100644 (file)
@@ -29,13 +29,13 @@ CMD_BIND(global_cmd_commands) {
     struct cmd_binding *cbind;
     int bindcount = 0;
     for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) {
-        if(cbind->botid == client->botid)
+        if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD))
             bindcount++;
     }
     struct cmd_binding *binds[bindcount];
     bindcount = 0;
     for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) {
-        if(cbind->botid == client->botid)
+        if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD))
             binds[bindcount++] = cbind;
     }
     qsort(binds, bindcount, sizeof(struct cmd_binding *), global_cmd_commands_sort);
index 8b9c72c4573ab60000075d2e6a14e20df36861f9..856da055dcf314d4b4b1f5aa1f6d33746098577c 100644 (file)
@@ -153,7 +153,7 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s
     struct cmd_binding *cbind;
     for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
         if(cbind->botid == client->botid && stricmp(cbind->cmd, message) == 0) {
-            if((cbind->flags & CMDFLAG_FUNCMD)) {
+            if((cbind->func->flags & CMDFLAG_FUNCMD)) {
                 if(!sent_chan)
                     break;
                 chan = sent_chan;