From d67fdae167bf5118b17d3bfaeb5f91929dfa812d Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 25 Jan 2014 01:47:04 +0100 Subject: add processing for the KICK irc message --- bouncer/ircserver.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'bouncer/ircserver.cpp') diff --git a/bouncer/ircserver.cpp b/bouncer/ircserver.cpp index 3b09d49..19bea9d 100644 --- a/bouncer/ircserver.cpp +++ b/bouncer/ircserver.cpp @@ -203,7 +203,7 @@ void IRCServer::lineReceivedEvent(char *line, int size) { } else if (strcmp(cmdBuf, "PART") == 0) { Channel *c = findChannel(targetBuf, false); if (c) { - c->handlePart(user, paramsAfterFirst);; + c->handlePart(user, paramsAfterFirst); return; } @@ -212,6 +212,24 @@ void IRCServer::lineReceivedEvent(char *line, int size) { i.second->handleQuit(user, allParams); return; + } else if (strcmp(cmdBuf, "KICK") == 0) { + char *space = strchr(paramsAfterFirst, ' '); + const char *kickMsg = ""; + + if (space) { + *space = 0; + kickMsg = space + 1; + + if (*kickMsg == ':') + ++kickMsg; + } + + Channel *c = findChannel(targetBuf, false); + if (c) { + c->handleKick(user, paramsAfterFirst, kickMsg); + return; + } + } else if (strcmp(cmdBuf, "NICK") == 0) { if (user.isSelf) { strncpy(currentNick, allParams, sizeof(currentNick)); -- cgit v1.2.3