}
static int loadNeonSpamSettings(struct ChanNode *chan) {
+ if(chan->spam_settings) return 0;
struct NeonSpamSettings *settings = malloc(sizeof(*settings));
if(!settings) {
perror("malloc() failed");
}
MYSQL_RES *res;
MYSQL_ROW row, defaults = NULL;
- printf_mysql_query("SELECT `channel_scanstate`, `channel_maxrepeat`, `channel_maxflood`, `channel_floodtime`, `channel_maxjoin`, `channel_jointime` FROM `channels` WHERE `channel_id` = '%d'", chan->channel_id);
+ printf_mysql_query("SELECT `channel_scanstate`, `channel_maxrepeat`, `channel_maxflood`, `channel_floodtime`, `channel_maxjoin`, `channel_jointime`, `channel_scanexcept` FROM `channels` WHERE `channel_id` = '%d'", chan->channel_id);
res = mysql_use();
row = mysql_fetch_row(res);
if(!row[0] || !row[1] || !row[2] || !row[3] || !row[4] || !row[5]) {
- printf_mysql_query("SELECT `channel_scanstate`, `channel_maxrepeat`, `channel_maxflood`, `channel_floodtime`, `channel_maxjoin`, `channel_jointime` FROM `channels` WHERE `channel_name` = 'defaults'");
+ printf_mysql_query("SELECT `channel_scanstate`, `channel_maxrepeat`, `channel_maxflood`, `channel_floodtime`, `channel_maxjoin`, `channel_jointime`, `channel_scanexcept` FROM `channels` WHERE `channel_name` = 'defaults'");
res = mysql_use();
defaults = mysql_fetch_row(res);
}
settings->flood_time = atoi(row[3] ? row[3] : defaults[3]);
settings->join_amount = atoi(row[4] ? row[4] : defaults[4]);
settings->join_time = atoi(row[5] ? row[5] : defaults[5]);
+ settings->exceptlevel = atoi(row[6] ? row[6] : defaults[6]);
chan->spam_settings = settings;
return 1;
}