From b01cbff3e16d5cbb26c63204a339f16224ebbe86 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 27 Sep 2020 16:49:40 +0200 Subject: [PATCH] Add message tags (such as server-time) to PONG. Requested by GaMbiTo- and KiwiIRC authors in https://bugs.unrealircd.org/view.php?id=5758 --- doc/RELEASE-NOTES.md | 1 + src/modules/pingpong.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/RELEASE-NOTES.md b/doc/RELEASE-NOTES.md index eca43cc2f..cca3f1572 100644 --- a/doc/RELEASE-NOTES.md +++ b/doc/RELEASE-NOTES.md @@ -7,6 +7,7 @@ Enhancements: * Add support for ```estonian-utf8```, ```latvian-utf8``` and ```lithuanian-utf8``` in [set::allowed-nickchars](https://www.unrealircd.org/docs/Nick_Character_Sets) +* Add message tags to ```PONG``` to help fix KiwiIRC timestamp issues. Fixes: * When having multiple text bans (```+b ~T:censor```) these caused an empty diff --git a/src/modules/pingpong.c b/src/modules/pingpong.c index 1e5a02bbc..42b577da0 100644 --- a/src/modules/pingpong.c +++ b/src/modules/pingpong.c @@ -93,8 +93,13 @@ CMD_FUNC(cmd_ping) } } else - sendto_one(client, NULL, ":%s PONG %s :%s", me.name, + { + MessageTag *mtags = NULL; + new_message(&me, recv_mtags, &mtags); + sendto_one(client, mtags, ":%s PONG %s :%s", me.name, (destination) ? destination : me.name, origin); + free_message_tags(mtags); + } } /* @@ -188,7 +193,10 @@ CMD_FUNC(cmd_pong) return; } else { - sendto_one(target, NULL, ":%s PONG %s %s", client->name, origin, destination); + MessageTag *mtags = NULL; + new_message(client, recv_mtags, &mtags); + sendto_one(target, mtags, ":%s PONG %s %s", client->name, origin, destination); + free_message_tags(mtags); } } else