changed Makefile; build all commands as an own file
[NeonServV5.git] / cmd_neonserv_recover.c
index 931e33972e9efa167dd632ce48e80eb4061d054d..b52e5cc9a18b895b3ac7f3800e80766fe8d0b5e3 100644 (file)
@@ -1,8 +1,10 @@
 
+#include "cmd_neonserv.h"
+
 /*
 * argv[0] - channel
 */
-static CMD_BIND(neonserv_cmd_recover) {
+CMD_BIND(neonserv_cmd_recover) {
     MYSQL_RES *res;
     MYSQL_ROW row, row2;
     char *channel = argv[0];
@@ -25,7 +27,7 @@ static CMD_BIND(neonserv_cmd_recover) {
         reply(getTextBot(), user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
         return;
     }
-    printf_mysql_query("SELECT `botid`, `max_channels`, `defaulttrigger` FROM `bots` WHERE `botclass` = '%d' ORDER BY `register_priority` DESC", client->botid);
+    printf_mysql_query("SELECT `id`, `max_channels`, `defaulttrigger` FROM `bots` WHERE `botclass` = '%d' ORDER BY `register_priority` DESC", client->botid);
     res = mysql_use();
     int botid = 0;
     char *bottrigger;
@@ -54,4 +56,5 @@ static CMD_BIND(neonserv_cmd_recover) {
         reply(getTextBot(), user, "NS_REGISTER_DISCONNECTED");
     printf_mysql_query("INSERT INTO `bot_channels` (`botid`, `chanid`, `trigger`) VALUES ('%d', '%d', '%s')", botid, chanid, bottrigger);
     reply(getTextBot(), user, "NS_RECOVER_DONE", channel);
+    logEvent(event);
 }