if(chanuser->user->flags & USERFLAG_ISAUTHED)
uaccess = getChannelAccess(chanuser->user, chanuser->chan, 0);
if(uaccess >= settings->exceptlevel) return;
+ //scanops / scanvoiced
+ MYSQL_RES *res;
+ MYSQL_ROW row, defaults;
+ loadChannelSettings(chanuser->chan);
+ printf_mysql_query("SELECT `%s`, `channel_getop`, `channel_getvoice` FROM `channels` WHERE `channel_id` = '%d'", reaction, chanuser->chan->channel_id);
+ res = mysql_use();
+ row = mysql_fetch_row(res);
+ if(!row[0] || !row[1] || !row[2]) {
+ printf_mysql_query("SELECT `%s`, `channel_getop`, `channel_getvoice` FROM `channels` WHERE `channel_name` = 'defaults'", reaction);
+ res = mysql_use();
+ defaults = mysql_fetch_row(res);
+ }
+ if(!(settings->flags & SPAMSETTINGS_SCANOPS) && uaccess >= atoi((row[1] ? row[1] : defaults[1]))) return;
+ if(!(settings->flags & SPAMSETTINGS_SCANVOICE) && uaccess >= atoi((row[2] ? row[2] : defaults[2]))) return;
if(action == SPAMSERV_CHECK_WARN) {
reply(client, chanuser->user, "%s", reason);
} else if(action == SPAMSERV_CHECK_PUNISH) {
- MYSQL_RES *res;
- MYSQL_ROW row;
- loadChannelSettings(chanuser->chan);
- printf_mysql_query("SELECT `%s` FROM `channels` WHERE `channel_id` = '%d'", reaction, chanuser->chan->channel_id);
- res = mysql_use();
- row = mysql_fetch_row(res);
- if(!row[0]) {
- printf_mysql_query("SELECT `%s` FROM `channels` WHERE `channel_name` = 'defaults'", reaction);
- res = mysql_use();
- row = mysql_fetch_row(res);
- }
int duration = 0;
char banmaskBuf[NICKLEN+USERLEN+HOSTLEN+3];
char *banmask = NULL;
- switch (atoi(row[0])) {
+ switch (atoi((row[0] ? row[0] : defaults[0]))) {
case 2: //TIMEBAN: 3min
duration = 180;
case 3: //TIMEBAN: 1h