2 static void neonserv_event_invite(struct ClientSocket *client, struct UserNode *user, char *channel) {
5 printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` LEFT JOIN `channels` ON `chanid` = `channel_id` WHERE `channel_name` = '%s' AND `botclass` = '%d'", escape_string(channel), client->botid);
7 if ((row = mysql_fetch_row(res)) == NULL) {
8 reply(client, user, "NS_INVITE_FAIL", channel, client->user->nick);
11 int botid = atoi(row[0]);
12 struct ClientSocket *bot;
13 for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
14 if(bot->clientid == botid)
18 struct ChanNode *chan = getChanByName(channel);
19 if(chan && isUserOnChan(bot->user, chan)) {
20 reply(client, user, "NS_INVITE_ON_CHAN", bot->user->nick, chan->name);
22 putsock(bot, "JOIN %s", channel);