summaryrefslogtreecommitdiff
path: root/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'message.c')
-rw-r--r--message.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/message.c b/message.c
index 1c511d2..9058814 100644
--- a/message.c
+++ b/message.c
@@ -477,17 +477,19 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
return 1;
}
- // Server 368 (RPL_ENDOFBANLIST) received? Send to any clients who requested a ban MODE query. - TODO - Identify and handle start/middle of ban responses.
- if (strncmp(tokens[1], "368", strlen(tokens[1])) == 0) {
- debugprint(DEBUG_FULL, "Server 368 (RPL_ENDOFBANLIST) found and it is: %s with length %zd! Sending to clients who are pending this.\n",
+ // Server 367 (RPL_BANLIST) or 368 (RPL_ENDOFBANLIST) received? Send to any clients who requested a ban MODE query.
+ if (strncmp(tokens[1], "367", strlen(tokens[1])) == 0 || strncmp(tokens[1], "368", strlen(tokens[1])) == 0) {
+ debugprint(DEBUG_FULL, "Server 367 (RPL_BANLIST) or 368 (RPL_ENDOFBANLIST) found and it is: %s with length %zd! Sending to clients who are pending this.\n",
tokens[1], strlen(tokens[1]));
// Relay to all pending clients
for (int i = 0; i < MAXCLIENTS; i++) {
if (clients[i].pendingban == 1) {
sendtoclient(clients[i].fd, str, clients, settings, 0);
- // And clear the pending flag
- clients[i].pendingban = 0;
+ // And clear the pending flag if it's 368 (RPL_ENDOFBANLIST)
+ if (strncmp(tokens[1], "368", strlen(tokens[1])) == 0) {
+ clients[i].pendingban = 0;
+ }
}
}