aboutsummaryrefslogtreecommitdiff
path: root/src/irc.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-13 05:50:57 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-13 05:50:57 -0400
commitceeb1b3e78514cf53fcc68e385ccc0498c5151f2 (patch)
treed0f596b211fc1cadb61a950cd3cba665deabb9ca /src/irc.c
parent1435ac4f6acd48835656246db77f117fd75957c0 (diff)
downloadfujinet-chat-ceeb1b3e78514cf53fcc68e385ccc0498c5151f2.tar.gz
Server pings show latency (WIP).
Diffstat (limited to 'src/irc.c')
-rw-r--r--src/irc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/irc.c b/src/irc.c
index 9f8118f..e2b8afa 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -139,6 +139,12 @@ static void print_ping_time(char *p) {
*/
}
+static void do_server_pong(void) {
+ msg_src = "Server";
+ // FIXME: what if the server doesn't :-quote the response?
+ print_ping_time(msg_text);
+}
+
/* FIXME: this isn't very fast */
static void do_ctcp(int is_notice) {
static char *p, *ctcp_type, *resp;
@@ -493,6 +499,8 @@ static void dispatch_msg(void) {
do_kick();
} else if(streq_i(msg_cmd, "MODE")) {
do_mode();
+ } else if(streq_i(msg_cmd, "PONG")) {
+ do_server_pong();
} else if(isdigit(msg_cmd[0])) {
do_numeric();
} else {