X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fmodules%2FNeonSpam.mod%2Fcmd_neonspam_set.c;h=752f2b25122ffe5aca3561f95369142f7929576e;hp=92bce288d6b502bcdc24f316a94166094ee987ac;hb=de5f0224c8b119f1be15457262bd6e66f160657f;hpb=9f5af1bc8ff4e8fc9c28433c76a890a990dd0ae5 diff --git a/src/modules/NeonSpam.mod/cmd_neonspam_set.c b/src/modules/NeonSpam.mod/cmd_neonspam_set.c index 92bce28..752f2b2 100644 --- a/src/modules/NeonSpam.mod/cmd_neonspam_set.c +++ b/src/modules/NeonSpam.mod/cmd_neonspam_set.c @@ -17,18 +17,18 @@ #include "cmd_neonspam.h" -typedef char* neonspam_cmd_set_function(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setflags(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_set_reaction(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_set_reaction_time(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setpercent(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setsensibility(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_set_spamlimit(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); -static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +typedef char* neonspam_cmd_set_function(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setflags(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_set_reaction(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_set_reaction_time(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setpercent(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setsensibility(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_set_spamlimit(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); +static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf); static MYSQL_ROW neonspam_settings_row, neonspam_settings_defaults; #define SPAMSERV_SETTINGS_QUERY "`channel_spam_reaction`, `channel_spam_reaction_duration`, `channel_flood_reaction`, `channel_flood_reaction_duration`, `channel_join_reaction`, `channel_join_reaction_duration`, `channel_botnet_bantime`, `channel_caps_reaction`, `channel_caps_reaction_duration`, `channel_digit_reaction`, `channel_digit_reaction_duration`, `channel_badword_reaction`, `channel_badword_reaction_duration`" @@ -155,7 +155,7 @@ CMD_BIND(neonspam_cmd_set) { if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; } else { - reply(getTextBot(), user, "NS_SET_DEFAULTS_OWNER", chan->name); + reply(textclient, user, "NS_SET_DEFAULTS_OWNER", chan->name); return; } } @@ -169,10 +169,10 @@ CMD_BIND(neonspam_cmd_set) { sprintf(defaultskey, "%08x", seed); if(argc > 1 && !strcmp(argv[1], defaultskey)) { printf_mysql_query("UPDATE `channels` SET " SPAMSERV_SETTINGS_RESET " WHERE `channel_id` = '%d'", chan->channel_id); - reply(getTextBot(), user, "NS_SET_DEFAULTS_DONE", chan->name); + reply(textclient, user, "NS_SET_DEFAULTS_DONE", chan->name); logEvent(event); } else { - reply(getTextBot(), user, "NS_SET_DEFAULTS_CODE", chan->name, defaultskey); + reply(textclient, user, "NS_SET_DEFAULTS_CODE", chan->name, defaultskey); } } else if(argc && strcmp(argv[0], "help")) { //find the correct command @@ -187,7 +187,7 @@ CMD_BIND(neonspam_cmd_set) { char valueBuf[MAXLEN], nameBuf[MAXLEN]; char *value, *optimized_value, *option_help; neonspam_cmd_set_function *func = neonspam_settings[i].function; - value = func(client, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, args, valueBuf); + value = func(client, textclient, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, args, valueBuf); if(value) { optimized_value = value; if(neonspam_settings[i].flags & SET_BOOL) { @@ -201,13 +201,13 @@ CMD_BIND(neonspam_cmd_set) { option_help = get_language_string(user, nameBuf); } else option_help = NULL; - reply(getTextBot(), user, "\002%s\002 %s%s%s", neonspam_settings[i].setting, optimized_value, (option_help ? " - " : ""), (option_help ? option_help : "")); + reply(textclient, user, "\002%s\002 %s%s%s", neonspam_settings[i].setting, optimized_value, (option_help ? " - " : ""), (option_help ? option_help : "")); if(neonspam_settings[i].flags & SET_OPT) { int maxoption = (neonspam_settings[i].flags & SET_OPT_MAX) >> SET_OPT_SHIFT; for(j = 0; j < maxoption; j++) { sprintf(nameBuf, "SS_SET_OPTION_%s_%d", neonspam_settings[i].setting, j); option_help = get_language_string(user, nameBuf); - reply(getTextBot(), user, " \002%d\002 - %s", j, option_help); + reply(textclient, user, " \002%d\002 - %s", j, option_help); } } if((neonspam_settings[i].flags & SET_HELP) && argc && !strcmp(argv[0], "help")) { @@ -215,7 +215,7 @@ CMD_BIND(neonspam_cmd_set) { sprintf(nameBuf, "SS_SET_HELP_%s", neonspam_settings[i].setting); tmp = get_language_string(user, nameBuf); if(tmp) { - reply(getTextBot(), user, " %s", tmp); + reply(textclient, user, " %s", tmp); } } } @@ -226,7 +226,7 @@ CMD_BIND(neonspam_cmd_set) { } if(j == 0) { //unknown setting - reply(getTextBot(), user, "NS_SET_UNKNOWN_SETTING", argv[0]); + reply(textclient, user, "NS_SET_UNKNOWN_SETTING", argv[0]); } } else { char valueBuf[MAXLEN], nameBuf[MAXLEN]; @@ -247,14 +247,14 @@ CMD_BIND(neonspam_cmd_set) { res = mysql_use(); neonspam_settings_row = mysql_fetch_row(res); i = -1; - reply(getTextBot(), user, "NS_SET_HEADER", chan->name); + reply(textclient, user, "NS_SET_HEADER", chan->name); while(neonspam_settings[++i].setting) { if((chan->spam_settings->flags & (neonspam_settings[i].if_flag & SPAMSETTINGS_FLAGS)) != (neonspam_settings[i].if_flag & SPAMSETTINGS_FLAGS)) continue; if((neonspam_settings[i].if_flag & SPAMSETTINGS_ISTIMEBAN) && !boolflag) continue; neonspam_cmd_set_function *func = neonspam_settings[i].function; - value = func(client, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, NULL, valueBuf); + value = func(client, textclient, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, NULL, valueBuf); if(neonspam_settings[i].if_flag & SPAMSETTINGS_SETTIMEBAN) boolflag = !strcmp(value, "2"); //TODO: append option or help info @@ -292,13 +292,13 @@ CMD_BIND(neonspam_cmd_set) { } char **table_lines = table_end(table); for(i = 0; i < table->entrys; i++) { - reply(getTextBot(), user, table_lines[i]); + reply(textclient, user, table_lines[i]); } table_free(table); } } -static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf) { +static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf) { char *trigger; //get current trigger MYSQL_RES *res; @@ -313,7 +313,7 @@ static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct UserNo if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; } else { - reply(getTextBot(), user, "NS_SET_TRIGGER_OWNER", chan->name); + reply(textclient, user, "NS_SET_TRIGGER_OWNER", chan->name); return NULL; } } @@ -327,7 +327,7 @@ static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct UserNo return trigger; } -static char* neonspam_cmd_setflags(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { +static char* neonspam_cmd_setflags(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { char *value = ((chan->spam_settings->flags & flag) ? "1" : "0"); if(argument) { //binary argument... @@ -336,7 +336,7 @@ static char* neonspam_cmd_setflags(struct ClientSocket *client, struct UserNode } else if(!strcmp(argument, "1") || !stricmp(argument, "on") || !stricmp(argument, get_language_string(user, "NS_SET_ON"))) { chan->spam_settings->flags |= flag; } else { - reply(getTextBot(), user, "NS_SET_INVALID_BOOLEAN", argument); + reply(textclient, user, "NS_SET_INVALID_BOOLEAN", argument); return NULL; } char str_flags[50]; @@ -347,13 +347,13 @@ static char* neonspam_cmd_setflags(struct ClientSocket *client, struct UserNode return value; } -static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int exceptlvl_index, char *field, char *argument, char *retBuf) { +static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int exceptlvl_index, char *field, char *argument, char *retBuf) { unsigned int value = chan->spam_settings->exceptlevel[exceptlvl_index]; if(argument) { //numeric argument... (access) int caccess = atoi(argument); if(caccess < 0 || caccess > 501) { - reply(getTextBot(), user, "NS_INVALID_ACCESS", caccess); + reply(textclient, user, "NS_INVALID_ACCESS", caccess); return NULL; } int uaccess = getChannelAccess(user, chan); @@ -362,7 +362,7 @@ static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct UserNode if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; } else { - reply(getTextBot(), user, "NS_SET_CANNOT_SET"); + reply(textclient, user, "NS_SET_CANNOT_SET"); return NULL; } } @@ -370,7 +370,7 @@ static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct UserNode if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; } else { - reply(getTextBot(), user, "NS_SET_BADLEVEL"); + reply(textclient, user, "NS_SET_BADLEVEL"); return NULL; } } @@ -382,7 +382,7 @@ static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct UserNode return retBuf; } -static char* neonspam_cmd_set_reaction(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int mysqlindex, char *mysqlfield, char *argument, char *retBuf) { +static char* neonspam_cmd_set_reaction(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int mysqlindex, char *mysqlfield, char *argument, char *retBuf) { if(argument) { /* valid options: * 0/kick - kick @@ -396,7 +396,7 @@ static char* neonspam_cmd_set_reaction(struct ClientSocket *client, struct UserN } else if(!strcmp(argument, "2") || !stricmp(argument, "ban")) { argument = "2"; } else { - reply(getTextBot(), user, "NS_SET_INVALID_OPTION_STR", argument); + reply(textclient, user, "NS_SET_INVALID_OPTION_STR", argument); return NULL; } printf_mysql_query("UPDATE `channels` SET `%s` = '%s' WHERE `channel_id` = '%d' ", mysqlfield, argument, chan->channel_id); @@ -415,12 +415,12 @@ static char* neonspam_cmd_set_reaction(struct ClientSocket *client, struct UserN } } -static char* neonspam_cmd_set_reaction_time(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int mysqlindex, char *mysqlfield, char *argument, char *retBuf) { +static char* neonspam_cmd_set_reaction_time(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int mysqlindex, char *mysqlfield, char *argument, char *retBuf) { int duration; if(argument) { duration = strToTime(user, argument); if(duration < 30) { - reply(getTextBot(), user, "NS_TIMEBAN_DURATION_TOO_SHORT", 30); + reply(textclient, user, "NS_TIMEBAN_DURATION_TOO_SHORT", 30); return NULL; } printf_mysql_query("UPDATE `channels` SET `%s` = '%s' WHERE `channel_id` = '%d' ", mysqlfield, argument, chan->channel_id); @@ -440,14 +440,14 @@ static char* neonspam_cmd_set_reaction_time(struct ClientSocket *client, struct return retBuf; } -static char* neonspam_cmd_setpercent(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int percent_index, char *mysqlfield, char *argument, char *retBuf) { +static char* neonspam_cmd_setpercent(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int percent_index, char *mysqlfield, char *argument, char *retBuf) { unsigned int value = chan->spam_settings->percent[percent_index]; if(argument) { //numeric argument... (access) value = atoi(argument); if(value < 0 || value > 100) { //invalid percent value - reply(getTextBot(), user, "SS_SET_PERCENT", value); + reply(textclient, user, "SS_SET_PERCENT", value); return NULL; } chan->spam_settings->percent[percent_index] = value; @@ -457,13 +457,13 @@ static char* neonspam_cmd_setpercent(struct ClientSocket *client, struct UserNod return retBuf; } -static char* neonspam_cmd_setsensibility(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int sensibility_index, char *mysqlfield, char *argument, char *retBuf) { +static char* neonspam_cmd_setsensibility(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int sensibility_index, char *mysqlfield, char *argument, char *retBuf) { if(argument) { //change value char *delimiter = strstr(argument, ":"); if(!delimiter) { //invalid format - reply(getTextBot(), user, "SS_SET_SENSIBILITY", argument); + reply(textclient, user, "SS_SET_SENSIBILITY", argument); return NULL; } *delimiter = '\0'; @@ -472,12 +472,12 @@ static char* neonspam_cmd_setsensibility(struct ClientSocket *client, struct Use int timep = atoi(delimiter); if(amount > MAX_FLOOD_AMOUNT || amount < MIN_FLOOD_AMOUNT) { //invalid amount - reply(getTextBot(), user, "SS_SET_SENSIBILITY_AMOUNT", amount, MIN_FLOOD_AMOUNT, MAX_FLOOD_AMOUNT); + reply(textclient, user, "SS_SET_SENSIBILITY_AMOUNT", amount, MIN_FLOOD_AMOUNT, MAX_FLOOD_AMOUNT); return NULL; } if(timep > MAX_FLOOD_TIME || timep < 0) { //invalid time period - reply(getTextBot(), user, "SS_SET_SENSIBILITY_TIME", timep, 0, MAX_FLOOD_TIME); + reply(textclient, user, "SS_SET_SENSIBILITY_TIME", timep, 0, MAX_FLOOD_TIME); return NULL; } char amountfield[50], timefield[50]; @@ -493,13 +493,13 @@ static char* neonspam_cmd_setsensibility(struct ClientSocket *client, struct Use return retBuf; } -static char* neonspam_cmd_set_spamlimit(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf) { +static char* neonspam_cmd_set_spamlimit(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int intparam, char *charparam, char *argument, char *retBuf) { if(argument) { //change value int amount = atoi(argument); if(amount > 10 || amount < 2) { //invalid amount - reply(getTextBot(), user, "SS_SET_SPAMLIMIT", amount, 2, 10); + reply(textclient, user, "SS_SET_SPAMLIMIT", amount, 2, 10); return NULL; } printf_mysql_query("UPDATE `channels` SET `channel_maxrepeat` = '%d' WHERE `channel_id` = '%d' ", amount, chan->channel_id); @@ -510,7 +510,7 @@ static char* neonspam_cmd_set_spamlimit(struct ClientSocket *client, struct User return retBuf; } -static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { +static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { int i = 0; int value = -1; int identical = 1; @@ -534,7 +534,7 @@ static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct UserNod } else if(!strcmp(argument, "1") || !stricmp(argument, "on") || !stricmp(argument, get_language_string(user, "NS_SET_ON"))) { value = 1; } else { - reply(getTextBot(), user, "NS_SET_INVALID_BOOLEAN", argument); + reply(textclient, user, "NS_SET_INVALID_BOOLEAN", argument); return NULL; } i = 0; @@ -542,7 +542,7 @@ static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct UserNod while(neonspam_settings[i].setting) { if(neonspam_settings[i].flags & SET_SCANOPS) { neonspam_cmd_set_function *func = neonspam_settings[i].function; - func(client, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, (value ? "1" : "0"), valueBuf); + func(client, textclient, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, (value ? "1" : "0"), valueBuf); } i++; } @@ -555,7 +555,7 @@ static char* neonspam_cmd_setscanops(struct ClientSocket *client, struct UserNod return "?"; } -static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { +static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { int i = 0; int value = -1; int identical = 1; @@ -579,7 +579,7 @@ static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct UserN } else if(!strcmp(argument, "1") || !stricmp(argument, "on") || !stricmp(argument, get_language_string(user, "NS_SET_ON"))) { value = 1; } else { - reply(getTextBot(), user, "NS_SET_INVALID_BOOLEAN", argument); + reply(textclient, user, "NS_SET_INVALID_BOOLEAN", argument); return NULL; } i = 0; @@ -587,7 +587,7 @@ static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct UserN while(neonspam_settings[i].setting) { if(neonspam_settings[i].flags & SET_SCANVOICE) { neonspam_cmd_set_function *func = neonspam_settings[i].function; - func(client, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, (value ? "1" : "0"), valueBuf); + func(client, textclient, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, (value ? "1" : "0"), valueBuf); } i++; } @@ -600,7 +600,7 @@ static char* neonspam_cmd_setscanvoice(struct ClientSocket *client, struct UserN return "?"; } -static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { +static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct ClientSocket *textclient, struct UserNode *user, struct ChanNode *chan, struct Event *event, int flag, char *charparam, char *argument, char *retBuf) { int i = 0; int value = -1; int identical = 1; @@ -621,7 +621,7 @@ static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct User //numeric argument... (access) int caccess = atoi(argument); if(caccess < 0 || caccess > 501) { - reply(getTextBot(), user, "NS_INVALID_ACCESS", caccess); + reply(textclient, user, "NS_INVALID_ACCESS", caccess); return NULL; } int uaccess = getChannelAccess(user, chan); @@ -630,7 +630,7 @@ static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct User if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; } else { - reply(getTextBot(), user, "NS_SET_CANNOT_SET"); + reply(textclient, user, "NS_SET_CANNOT_SET"); return NULL; } } @@ -638,7 +638,7 @@ static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct User if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; } else { - reply(getTextBot(), user, "NS_SET_BADLEVEL"); + reply(textclient, user, "NS_SET_BADLEVEL"); return NULL; } } @@ -648,7 +648,7 @@ static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct User while(neonspam_settings[i].setting) { if(neonspam_settings[i].flags & SET_SCANEXCEPT) { neonspam_cmd_set_function *func = neonspam_settings[i].function; - func(client, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, retBuf, valueBuf); + func(client, textclient, user, chan, event, neonspam_settings[i].intparam, neonspam_settings[i].charparam, retBuf, valueBuf); } i++; }