From e3013792ea7a4b05ea44ae29fb462ceba323b0e8 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 28 Oct 2022 01:28:32 +0100 Subject: enpongment --- irc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/irc.c b/irc.c index 314c3b7..5af46ae 100644 --- a/irc.c +++ b/irc.c @@ -1,5 +1,6 @@ - #include "irc.h" + +#include "debug.h" #include "conf.h" #include "util.h" @@ -76,6 +77,13 @@ handle(char msg[], size_t len) } } printf("}\n"); + + if (len >=4 && strncmp(msg, "PING", 4) == 0) { + DP("ponging"); + // this modifies buffer in place. which is presumably fine + msg[1] = 'O'; + irc_sendall(msg,len); + } } -- cgit v1.2.3