diff options
author | Treeki <treeki@gmail.com> | 2014-01-25 01:47:04 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-01-25 01:47:04 +0100 |
commit | d67fdae167bf5118b17d3bfaeb5f91929dfa812d (patch) | |
tree | c064c5b235e1ffbf0e28d8b075e8ae70919aca01 /bouncer/ircserver.cpp | |
parent | bdbdb57fc3ae81c0dbb46c4e6ffdd6c0205a81c0 (diff) | |
download | bounce4-d67fdae167bf5118b17d3bfaeb5f91929dfa812d.tar.gz bounce4-d67fdae167bf5118b17d3bfaeb5f91929dfa812d.zip |
add processing for the KICK irc message
Diffstat (limited to '')
-rw-r--r-- | bouncer/ircserver.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
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)); |