summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c
index 886d8b8..07bee1a 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -1543,6 +1543,13 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
// Send original request straight to server
sendtoserver(server_ssl, str, strlen(str), sourcefd, clients, settings);
+ // If it seems to be a CTCP VERSION request, just send to the server (CTCP requests are delimited with \1)
+ if (counter == 3 && strncmp(tokens[2], ":\1VERSION\1", strlen(tokens[2])) == 0) {
+ printf("Client PRIVMSG looked like a CTCP VERSION request, so not sending to other clients.\n");
+ free(strcopyPtr);
+ return 1;
+ }
+
// Rebuild to full PRIVMSG string and relay to all other clients
char outgoingmsg[MAXDATASIZE]; // String to send to client
@@ -1660,6 +1667,19 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
return 1;
}
+ // Client NOTICE received
+ if (strncasecmp(tokens[0], "NOTICE", strlen(tokens[0])) == 0) {
+ // If it's a CTCP VERSION response then only send to the server (CTCP requests are delimited with \1)
+ if (counter >= 3 && strncmp(tokens[2], ":\1VERSION", strlen(tokens[2])) == 0) {
+ printf("Client NOTICE looked like a CTCP VERSION response, so just sending to the server.\n");
+ sendtoserver(server_ssl, str, strlen(str), sourcefd, clients, settings);
+ free(strcopyPtr);
+ return 1;
+ }
+
+ // If it wasn't a CTCP VERSION response, then let this fall through to the default unhandled action by not returning here
+ }
+
// Custom BLABOUNCER command received
// Case insensitive comparisons here since clients won't be recognising and uppercasing these commands
if (strncasecmp(tokens[0], "BLABOUNCER", strlen(tokens[0])) == 0) {