diff options
Diffstat (limited to 'message.c')
-rw-r--r-- | message.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -602,6 +602,7 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int sendtoclient(clients[i].fd, str, clients, settings, 0); // And clear the pending flag if it's 368 (RPL_ENDOFBANLIST) if (strncmp(tokens[1], "368", strlen(tokens[1])) == 0) { + debugprint(DEBUG_FULL, "368 (RPL_ENDOFBANLIST) received, setting pendingban = 0 on client fd %d.\n", clients[i].fd); clients[i].pendingban = 0; } } @@ -1206,8 +1207,9 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int if (strncasecmp(tokens[0], "MODE", strlen(tokens[0])) == 0) { debugprint(DEBUG_FULL, "Client MODE found and it is: %s with length %zd! Analysing...\n", tokens[0], strlen(tokens[0])); // Is it a ban MODE request (MODE #channel b)? - // TODO - Can something else beginning with "b" be in this position? Need a length comparison? - if (counter >= 3 && strncmp(tokens[2], "b", strlen("b")) == 0) { + if (counter >= 3 && (((strlen(tokens[2]) == strlen("b")) && strncmp(tokens[2], "b", strlen("b")) == 0) + || ((strlen(tokens[2]) == strlen("+b")) && strncmp(tokens[2], "+b", strlen("+b")) == 0)) + ) { debugprint(DEBUG_FULL, "Ban MODE request received, marking as pending.\n"); clients[clientindex].pendingban = 1; } else if (counter == 2) { |