get default reaction if nothing else is set
authorpk910 <philipp@zoelle1.de>
Thu, 20 Oct 2011 12:50:11 +0000 (14:50 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 20 Oct 2011 12:50:11 +0000 (14:50 +0200)
src/event_neonspam_chanmsg.c

index bb473443716763fa74bfbbd0f331b018158427be..5383791719080a2d3d9ad046afc7e17e3724ef14 100644 (file)
@@ -142,6 +142,11 @@ static void neonspam_event_chanmsg_punish(struct ClientSocket *client, struct Ch
         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;