From fb3963446890cbb966db2d463813d15701cd8fb1 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 6 Sep 2019 20:48:15 +0100 Subject: Add BLABOUNCER HELP as a valid command to avoid the unrecognised command error. --- TODO | 2 -- message.c | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 14b4d65..a4ada59 100644 --- a/TODO +++ b/TODO @@ -12,8 +12,6 @@ Option to include date in replay log replay. Do server operator messages and commands work? -Add BLABOUNCER HELP as a valid command to avoid the unrecognised command error. - (I vaguely recall) some unwanted stuff (channel ban info?) was relayed to another client upon a client connecting. PM replay chat in a channel (or perhaps a random channel?) e.g. replay on 06/09/2019 at 17:05 from 13:49 in #insomnia - maybe a client thing. diff --git a/message.c b/message.c index 6aa2725..f360e99 100644 --- a/message.c +++ b/message.c @@ -1323,11 +1323,14 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int } return 1; - // Unrecognised BLABOUNCER command received, send some help instructions + // Unrecognised BLABOUNCER command received (or a BLABOUNCER HELP command), send some help instructions } else { - debugprint(DEBUG_SOME, "Client BLABOUNCER unrecognised command found and it is: %s with length %zd! Sending a help message.\n", tokens[1], strlen(tokens[1])); - snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Unrecognised BLABOUNCER command received. Valid commands are:", ircdstate->ircnick); - sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); + // Debug and NOTICE an unrecognised command error unless the command was "HELP" + if (strncasecmp(tokens[1], "HELP", strlen("HELP")) != 0) { + debugprint(DEBUG_SOME, "Client BLABOUNCER unrecognised command found and it is: %s with length %zd! Sending a help message.\n", tokens[1], strlen(tokens[1])); + snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Unrecognised BLABOUNCER command received. Valid commands are:", ircdstate->ircnick); + sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); + } snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :\"BLABOUNCER REPLAY [[[days:]hours:]minutes:]\" (To replay a given length of time of replay log.)", ircdstate->ircnick); sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :\"BLABOUNCER REHASH\" (To reload settings from the configuration file, see README for which settings can be reloaded.)", ircdstate->ircnick); -- cgit v1.2.3