summaryrefslogtreecommitdiff
path: root/message.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-12-23 11:05:25 +0000
committerLuke Bratch <luke@bratch.co.uk>2019-12-23 11:05:25 +0000
commit886629c16b9a24099f0e9cce5a5c92b3c901685b (patch)
treeb9b349897f635d97d1644c99a896d2ee720cdf8b /message.c
parent0883de2c491a8c79aec13d25bab429aea4362a10 (diff)
Add BLABOUNCER VERSION command and change version string to have -git suffix between releases.
Diffstat (limited to 'message.c')
-rw-r--r--message.c10
1 files changed, 10 insertions, 0 deletions
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);
@@ -1426,6 +1428,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 {
// Debug and NOTICE an unrecognised command error unless the command was "HELP"
@@ -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;
}
}