From 886629c16b9a24099f0e9cce5a5c92b3c901685b Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Mon, 23 Dec 2019 11:05:25 +0000 Subject: Add BLABOUNCER VERSION command and change version string to have -git suffix between releases. --- message.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'message.c') diff --git a/message.c b/message.c index e30a247..7d50f0a 100644 --- a/message.c +++ b/message.c @@ -966,6 +966,8 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :\"BLABOUNCER QUIT [quit message]\" (To quit blabouncer, optionally sending [quit message] to the server.)", ircdstate->ircnick); sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); + snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :\"BLABOUNCER VERSION\" (To show the current blabouncer version.)", ircdstate->ircnick); + sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); // Get the channel count so we can iterate over all channels. int channelcount = getchannelcount(channels, ircdstate->maxchannelcount); @@ -1425,6 +1427,12 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int } } + return 1; + // VERSION received, send current blabouncer version + } else if (strncasecmp(tokens[1], "VERSION", strlen("VERSION")) == 0) { + debugprint(DEBUG_SOME, "Client BLABOUNCER VERSION found and it is: %s with length %zd!\n", tokens[1], strlen(tokens[1])); + snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :This is blabouncer version %s!", ircdstate->ircnick, VERSION); + sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); return 1; // Unrecognised BLABOUNCER command received (or a BLABOUNCER HELP command), send some help instructions } else { @@ -1442,6 +1450,8 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :\"BLABOUNCER QUIT [quit message]\" (To quit blabouncer, optionally sending [quit message] to the server.)", ircdstate->ircnick); sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); + snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :\"BLABOUNCER VERSION\" (To show the current blabouncer version.)", ircdstate->ircnick); + sendtoclient(sourcefd, outgoingmsg, clients, settings, 0); return 1; } } -- cgit v1.2.3