-/* cmd_global_unregister.c - NeonServ v5.4
+/* cmd_global_unregister.c - NeonServ v5.6
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
else
channel = (chan ? chan->name : "");
if(!is_valid_chan(channel)) {
- reply(getTextBot(), user, "NS_INVALID_CHANNEL_NAME", channel);
+ reply(textclient, user, "NS_INVALID_CHANNEL_NAME", channel);
return;
}
int chanid;
if ((row = mysql_fetch_row(res)) != NULL) {
chanid = atoi(row[0]);
} else {
- reply(getTextBot(), user, "NS_UNREGISTER_NOT_REGISTERED", channel, client->user->nick);
+ reply(textclient, user, "NS_UNREGISTER_NOT_REGISTERED", channel, client->user->nick);
return;
}
if(client->botid == NEONSERV_BOTID && !strcmp(row[1], "1")) {
- reply(getTextBot(), user, "NS_UNREGISTER_NODELETE", channel);
+ reply(textclient, user, "NS_UNREGISTER_NODELETE", channel);
return;
}
int sync_neonspam_unreg = get_int_field("General.sync_neonspam_unreg");
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", channel, client->user->nick);
+ reply(textclient, user, "NS_UNREGISTER_NOT_REGISTERED", channel, client->user->nick);
return;
}
int botid = atoi(row[0]);
break;
}
printf_mysql_query("DELETE FROM `bot_channels` WHERE `id` = '%s'", row[1]);
- reply(getTextBot(), user, "NS_UNREGISTER_DONE", channel);
+ reply(textclient, user, "NS_UNREGISTER_DONE", channel);
if(bot && strcmp(row[2], "1")) {
putsock(bot, "PART %s :Channel unregistered.", channel);
}