for(i = 0; i < cbind->paramcount; i++)
free(cbind->parameters[i]);
}
+ if(cbind->channel_access)
+ free(cbind->channel_access);
free(cbind);
return 1;
} else
return 0;
}
+int unbind_botwise_allcmd(int clientid) {
+ int i;
+ for(i = 0; i < 27; i++) {
+ struct cmd_binding *cbind, *next, *last = NULL;
+ for(cbind = cmd_binds[i]; cbind; cbind = next) {
+ next = cbind->next;
+ if(clientid == cbind->clientid) {
+ if(last)
+ last->next = cbind->next;
+ else
+ cmd_binds[i] = cbind->next;
+ free(cbind->cmd);
+ if(cbind->paramcount) {
+ int j;
+ for(j = 0; j < cbind->paramcount; j++)
+ free(cbind->parameters[j]);
+ }
+ if(cbind->channel_access)
+ free(cbind->channel_access);
+ free(cbind);
+ } else
+ last = cbind;
+ }
+ }
+ return 1;
+}
+
struct cmd_function *find_cmd_function(int botid, char *name) {
struct cmd_function *cmdfunc;
char *c;