fixed cmd_myaccess: do not show channels from inactive bots
authorpk910 <philipp@zoelle1.de>
Sat, 10 Dec 2011 08:44:45 +0000 (09:44 +0100)
committerpk910 <philipp@zoelle1.de>
Sat, 10 Dec 2011 08:44:45 +0000 (09:44 +0100)
src/cmd_neonserv_myaccess.c

index 0ab6418a10f95a854917bae6e029ff0e856a7ef8..8c7dd143fbbc0d4264e6374b83780e44127e236d 100644 (file)
@@ -135,7 +135,7 @@ static void neonserv_cmd_myaccess_async1(struct ClientSocket *client, struct Cli
     if ((user_row = mysql_fetch_row(res)) != NULL) {
         userid = atoi(user_row[0]);
         //check if the user is already added
-        printf_mysql_query("SELECT `chanuser_access`, `chanuser_flags`, `chanuser_infoline`, `channel_name`, `channel_getop`, `channel_getvoice`, `botid` FROM `chanusers` LEFT JOIN `channels` ON `chanuser_cid` = `channel_id` LEFT JOIN `bot_channels` ON `chanuser_cid` = `chanid` LEFT JOIN `bots` ON `bots`.`id` = `botid` WHERE `chanuser_uid` = '%d' AND `botclass` = '%d' ORDER BY `chanuser_access` DESC, `channel_name` ASC", userid, client->botid);
+        printf_mysql_query("SELECT `chanuser_access`, `chanuser_flags`, `chanuser_infoline`, `channel_name`, `channel_getop`, `channel_getvoice`, `botid` FROM `chanusers` LEFT JOIN `channels` ON `chanuser_cid` = `channel_id` LEFT JOIN `bot_channels` ON `chanuser_cid` = `chanid` LEFT JOIN `bots` ON `bots`.`id` = `botid` WHERE `chanuser_uid` = '%d' AND `botclass` = '%d' AND `active` = '1' ORDER BY `chanuser_access` DESC, `channel_name` ASC", userid, client->botid);
         res = mysql_use();
         total_count = mysql_num_rows(res);
         table = table_init(4, total_count + 1, 0);