#include "UserNode.h"
#include "ChanNode.h"
#include "ChanUser.h"
+#include "WHOHandler.h"
struct trigger_callback {
int botid;
static USERAUTH_CALLBACK(command_checked_auth) {
struct command_check_user_cache *cache = data;
int execute_cmd = 1;
- if((cbind->func->flags & CMDFLAG_REQUIRE_AUTH) && !(user->flags & USERFLAG_ISAUTHED)) {
+ if((cache->cbind->func->flags & CMDFLAG_REQUIRE_AUTH) && !(user->flags & USERFLAG_ISAUTHED)) {
//AUTH_REQUIRED
execute_cmd = 0;
}
chan = chan2;
}
}
- if(cbind->func->parameters) {
+ if(cbind->parameters) {
//userdefined parameters...
char *uarga[MAXNUMPARAMS];
- char params[strlen(cbind->func->parameters)+1];
- strcpy(params, cbind->func->parameters);
+ char params[strlen(cbind->parameters)+1];
+ strcpy(params, cbind->parameters);
int uargpos = 0, argi, allargs = 0;
- char *ppos = params, *prev_ppos = params;
+ char *ppos = params;
+ char *prev_ppos = params;
while(ppos = strstr(ppos, " ")) {
ppos = '\0';
if(prev_ppos[0] == '%') {
prev_ppos[strlen(prev_ppos)-1] = '\0';
} else
allargs = 0;
- if((argi = atoi(prev_ppos)) > 0) {
+ argi = atoi(prev_ppos);
+ if(argi > 0) {
if(argi <= argc) continue;
uarga[uargpos++] = argv[argi-1]
if(allargs) {
data->chan = chan;
data->message = message;
data->cbind = cbind;
- get_userauth(user, command_checked_auth, data)
+ get_userauth(user, command_checked_auth, data);
return;
}
if((cbind->func->flags & CMDFLAG_REQUIRE_AUTH) && !(user->flags & USERFLAG_ISAUTHED)) {