Another year is about to end... So we have to update these damn copyright information :P
[NeonServV5.git] / src / cmd_neonspam_set.c
index 799045c0ab70c8e002cbed1820f50b5c849c6bc3..139e1efce812bda540f9d2f60c1951ec7290e4fd 100644 (file)
@@ -1,5 +1,5 @@
-/* cmd_neonspam_set.c - NeonServ v5.2
- * Copyright (C) 2011  Philipp Kreil (pk910)
+/* cmd_neonspam_set.c - NeonServ v5.3
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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) {