From: pk910 Date: Thu, 9 Feb 2012 17:13:41 +0000 (+0100) Subject: fixed ZNC support X-Git-Tag: v5.3~18 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=a9e59c11deabf293b01fae73f4f3f2ca79800c5a fixed ZNC support --- diff --git a/src/IRCParser.c b/src/IRCParser.c index c499982..b6fc71e 100644 --- a/src/IRCParser.c +++ b/src/IRCParser.c @@ -482,22 +482,30 @@ static IRC_CMD(raw_topic) { static IRC_CMD(raw_privmsg) { if(from == NULL || argc < 2) return 0; + if(!stricmplen(from, "*status", 7) || !stricmplen(from, "-sBNC", 5)) { + #ifdef HAVE_THREADS + unsigned int tid = (unsigned int) pthread_self_tid(); + while(!clientsocket_parseorder_top(tid)) { + usleep(1000); //1ms + } + #endif + if(!match("Disconnected from IRC.*", argv[1])) { + //ZNC DISCONNECT + bot_disconnect(client); + return 1; + } + if(!match("* disconnected from the server.", argv[1])) { + //sBNC DISCONNECT + bot_disconnect(client); + return 1; + } + } struct UserNode *user = getUserByMask(from); if(user == NULL) { user = createTempUserMask(from); if(!user) return 0; user->flags |= USERFLAG_ISTMPUSER; } - if(!stricmp(user->nick, "*status") && !match("Disconnected from IRC.*", argv[1])) { - //ZNC DISCONNECT - bot_disconnect(client); - return 1; - } - if(!stricmp(user->nick, "-sBNC") && !match("* disconnected from the server.", argv[1])) { - //sBNC DISCONNECT - bot_disconnect(client); - return 1; - } if(argv[0][0] == '#') { //Channel message struct ChanNode *chan = getChanByName(argv[0]); if(chan && chan->chanbot == client->user) {