X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fcmd_global_unregister.c;h=43dab20796f171615c61b67c487001eb0d539b22;hp=058f38b142f224527ad31a2976e06d0362fe74b3;hb=c32e8254ec4ed0d77757e32f8aa5aabcdb494057;hpb=77b1c3e45f25e5a000b06a551e3b2329ad2db8a0 diff --git a/src/cmd_global_unregister.c b/src/cmd_global_unregister.c index 058f38b..43dab20 100644 --- a/src/cmd_global_unregister.c +++ b/src/cmd_global_unregister.c @@ -42,19 +42,18 @@ CMD_BIND(global_cmd_unregister) { return; } if(client->botid == 0) - printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended`, `bots`.`id` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '0' AND `botid` = '%d'", chanid, client->clientid); + 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` = '0' AND `botid` = '%d'", chanid, client->clientid); else - printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended`, `bots`.`id` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chanid, client->botid); + 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); return; } int botid = atoi(row[0]); - int clientid = atoi(row[3]); struct ClientSocket *bot; for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) { - if(bot->clientid == botid && (!botid || bot->clientid == clientid)) + if(bot->clientid == botid) break; } if(bot && strcmp(row[2], "1")) {