fixed neonspam cmd_set (support for default trigger)
authorpk910 <philipp@zoelle1.de>
Thu, 29 Dec 2011 17:04:28 +0000 (18:04 +0100)
committerpk910 <philipp@zoelle1.de>
Thu, 29 Dec 2011 17:04:28 +0000 (18:04 +0100)
see: http://git.pk910.de/?p=NeonServV5.git;a=commit;h=fdca567267cf8843fb71a493b40343d5db3f3c3b

src/cmd_neonspam_set.c

index cb52314158cfc2bf2ea27031521c37ce6ff80915..00a4d1c816a1cb76ed51512d4f0d9e860c0ff579 100644 (file)
@@ -292,10 +292,10 @@ static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct UserNo
     //get current trigger
     MYSQL_RES *res;
     MYSQL_ROW row;
-    printf_mysql_query("SELECT `trigger` FROM `bot_channels` WHERE `chanid` = '%d' AND `botid` = '%d'", chan->channel_id, client->clientid);
+    printf_mysql_query("SELECT `trigger`, `defaulttrigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botid` = '%d'", chan->channel_id, client->clientid);
     res = mysql_use();
     row = mysql_fetch_row(res);
-    trigger = row[0];
+    trigger = (row[0] ? row[0] : row[1]);
     if(argument) {
         int uaccess = getChannelAccess(user, chan);
         if(uaccess < 500) {