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;
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]);
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);
}