X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fbot_NeonServ.c;h=53ad3512f03ab090b8531bdad6ba896e616b91be;hb=c575e458c6257e75b97884847143b20965a5dfda;hp=ea5b662927348f915cbb44c4e4a1cd8d067a232a;hpb=9b2a1231294413f079b2d5620ce7066687ae1d03;p=NeonServV5.git diff --git a/src/bot_NeonServ.c b/src/bot_NeonServ.c index ea5b662..53ad351 100644 --- a/src/bot_NeonServ.c +++ b/src/bot_NeonServ.c @@ -1,4 +1,4 @@ -/* bot_NeonServ.c - NeonServ v5.1 +/* bot_NeonServ.c - NeonServ v5.2 * Copyright (C) 2011 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify @@ -32,7 +32,6 @@ #include "DBHelper.h" #include "tools.h" #include "timeq.h" -#include "version.h" #include "EventLogger.h" #include "cmd_neonserv.h" @@ -368,6 +367,10 @@ static void neonserv_trigger_callback(struct ChanNode *chan, char *trigger) { MYSQL_RES *res; MYSQL_ROW row; loadChannelSettings(chan); + if(!(chan->flags & CHANFLAG_CHAN_REGISTERED)) { + strcpy(trigger, "+"); + return; + } printf_mysql_query("SELECT `trigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chan->channel_id, BOTID); res = mysql_use(); row = mysql_fetch_row(res); @@ -380,7 +383,7 @@ static void start_bots() { MYSQL_RES *res, *res2; MYSQL_ROW row; - printf_mysql_query("SELECT `nick`, `ident`, `realname`, `server`, `port`, `pass`, `textbot`, `id` FROM `bots` WHERE `botclass` = '%d' AND `active` = '1'", BOTID); + printf_mysql_query("SELECT `nick`, `ident`, `realname`, `server`, `port`, `pass`, `textbot`, `id`, `queue` FROM `bots` WHERE `botclass` = '%d' AND `active` = '1'", BOTID); res = mysql_use(); while ((row = mysql_fetch_row(res)) != NULL) { @@ -391,6 +394,7 @@ static void start_bots() { user->flags |= USERFLAG_ISBOT; client = create_socket(row[3], atoi(row[4]), row[5], user); client->flags |= (strcmp(row[6], "0") ? SOCKET_FLAG_PREFERRED : 0); + client->flags |= (strcmp(row[8], "0") ? SOCKET_FLAG_USE_QUEUE : 0); client->botid = BOTID; client->clientid = atoi(row[7]); connect_socket(client); @@ -506,7 +510,7 @@ void init_NeonServ() { bind_part(neonserv_event_part); bind_quit(neonserv_event_quit); bind_chanctcp(neonserv_event_chanctcp); - bind_privctcp(neonserv_event_privctcp); + bind_privctcp(general_event_privctcp); bind_channotice(neonserv_event_channotice); bind_topic(neonserv_event_topic); bind_invite(neonserv_event_invite);