removed getTextBot() function and added textbot parameter to the CMD_BIND header...
[NeonServV5.git] / src / modules / global.mod / cmd_global_move.c
index 3a1d50f425b885e49d54db178bf9cffa7dc48af8..aeac792a99d35f68f543f0f929ac4fb17ae76eac 100644 (file)
@@ -27,17 +27,17 @@ CMD_BIND(global_cmd_move) {
     char *channel = argv[0];
     char *new_channel = argv[1];
     if(!is_valid_chan(new_channel)) {
-        reply(getTextBot(), user, "NS_INVALID_CHANNEL_NAME", new_channel);
+        reply(textclient, user, "NS_INVALID_CHANNEL_NAME", new_channel);
         return;
     }
     if(!stricmp(channel, new_channel)) {
-        reply(getTextBot(), user, "NS_MOVE_SELF");
+        reply(textclient, user, "NS_MOVE_SELF");
         return;
     }
     printf_mysql_query("SELECT `channel_id` FROM `bot_channels` LEFT JOIN `channels` ON `channel_id` = `chanid` WHERE `channel_name` = '%s'", escape_string(new_channel));
     res = mysql_use();
     if ((row = mysql_fetch_row(res)) != NULL) {
-        reply(getTextBot(), user, "NS_REGISTER_ALREADY", new_channel, client->user->nick);
+        reply(textclient, user, "NS_REGISTER_ALREADY", new_channel, client->user->nick);
         return;
     }
     int chanid;
@@ -46,17 +46,17 @@ CMD_BIND(global_cmd_move) {
     if ((row = mysql_fetch_row(res)) != NULL) {
         chanid = atoi(row[0]);
     } else {
-        reply(getTextBot(), user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
+        reply(textclient, user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
         return;
     }
     printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chanid, client->botid);
     res = mysql_use();
     if ((row = mysql_fetch_row(res)) == NULL) {
-        reply(getTextBot(), user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
+        reply(textclient, user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
         return;
     }
     if(!strcmp(row[2], "1")) {
-        reply(getTextBot(), user, "NS_MOVE_SUSPENDED");
+        reply(textclient, user, "NS_MOVE_SUSPENDED");
         return;
     }
     int botid = atoi(row[0]);
@@ -92,6 +92,6 @@ CMD_BIND(global_cmd_move) {
         channode->flags &= ~CHANFLAG_CHAN_REGISTERED;
         channode->channel_id = 0;
     }
-    reply(getTextBot(), user, "NS_MOVE_DONE", channel, new_channel);
+    reply(textclient, user, "NS_MOVE_DONE", channel, new_channel);
     logEvent(event);
 }