diff options
Diffstat (limited to 'message.c')
-rw-r--r-- | message.c | 30 |
1 files changed, 13 insertions, 17 deletions
@@ -240,16 +240,14 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int // Just get the nick for comparison extractnickfromprefix(prefixcopy, 1); if ((strlen(prefixcopy) == strlen(ircdstate->ircnick)) && (strncmp(prefixcopy, ircdstate->ircnick, strlen(tokens[0])) == 0)) { - debugprint(DEBUG_FULL, "Server PART: nick is ours ('%s' vs '%s').\n", prefixcopy, ircdstate->ircnick); + debugprint(DEBUG_FULL, "Server PART: nick is ours ('%s' vs '%s'), removing channel.\n", prefixcopy, ircdstate->ircnick); removechannel(channels, ircdstate->maxchannelcount, tokens[2]); } else { - debugprint(DEBUG_FULL, "Server PART: nick is NOT ours ('%s' vs '%s').\n", prefixcopy, ircdstate->ircnick); - } - - // Remove the PARTing nick from our local channel struct - // TODO - don't bother with this if we did removechannel() above? - if (!removenickfromchannel(tokens[0], tokens[2], channels, ircdstate->maxchannelcount)) { - debugprint(DEBUG_CRIT, "Failed to remove nick from channel struct.\n"); + debugprint(DEBUG_FULL, "Server PART: nick is NOT ours ('%s' vs '%s'), removing nick from channel.\n", prefixcopy, ircdstate->ircnick); + // Remove the PARTing nick from our local channel struct + if (!removenickfromchannel(tokens[0], tokens[2], channels, ircdstate->maxchannelcount)) { + debugprint(DEBUG_CRIT, "Failed to remove nick from channel struct.\n"); + } } // And then send to all clients @@ -276,17 +274,15 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int // If the user being KICKed is us, then we must have left a channel, so remove it from our local channel array. // (If it's not us, then it's another user being KICKed from a channel, so just pass straight through to letting all our clients know.) if ((strlen(tokens[3]) == strlen(ircdstate->ircnick)) && (strncmp(tokens[3], ircdstate->ircnick, strlen(tokens[3])) == 0)) { - debugprint(DEBUG_FULL, "Server KICK: nick is ours ('%s' vs '%s').\n", tokens[3], ircdstate->ircnick); + debugprint(DEBUG_FULL, "Server KICK: nick is ours ('%s' vs '%s'), removing channel.\n", tokens[3], ircdstate->ircnick); removechannel(channels, ircdstate->maxchannelcount, tokens[2]); } else { - debugprint(DEBUG_FULL, "Server KICK: nick is NOT ours ('%s' vs '%s').\n", tokens[3], ircdstate->ircnick); - } - - // Remove the KICKed nick from our local channel struct - // TODO - removenickfromchannel() first argument expects ":nick!user@host" but we're passing "nick" here - // TODO - don't bother with this if we did removechannel() above? - if (!removenickfromchannel(tokens[3], tokens[2], channels, ircdstate->maxchannelcount)) { - debugprint(DEBUG_CRIT, "Server KICK: Failed to remove nick from channel struct.\n"); + debugprint(DEBUG_FULL, "Server KICK: nick is NOT ours ('%s' vs '%s'), removing nick from channel.\n", tokens[3], ircdstate->ircnick); + // Remove the KICKed nick from our local channel struct + // TODO - removenickfromchannel() first argument expects ":nick!user@host" but we're passing "nick" here + if (!removenickfromchannel(tokens[3], tokens[2], channels, ircdstate->maxchannelcount)) { + debugprint(DEBUG_CRIT, "Server KICK: Failed to remove nick from channel struct.\n"); + } } // And then send to all clients |