From e707a5f2d471fb2e333301010e477a02064cae91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Martin?= Date: Fri, 9 Oct 2026 17:54:51 +0200 Subject: [PATCH] IRC: add the firmware version to the CTCP VERSION reply Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk --- lib/irc/src/irc_session.cpp | 3 ++- test/test_irc_session/test_irc_session.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/irc/src/irc_session.cpp b/lib/irc/src/irc_session.cpp index 4f698ee..a77c619 100644 --- a/lib/irc/src/irc_session.cpp +++ b/lib/irc/src/irc_session.cpp @@ -4,6 +4,7 @@ #include #include "base64.h" +#include "version.h" namespace roro { @@ -284,7 +285,7 @@ void IrcSession::onPrivmsg(const IrcMessage& m, int64_t utc, bool notice) { action = true; text = rest; } else { - if (verb == "VERSION" && !notice) send(std::string("NOTICE ") + from + " :" + kCtcp + "VERSION roro9stack" + kCtcp); + if (verb == "VERSION" && !notice) send(std::string("NOTICE ") + from + " :" + kCtcp + "VERSION " + kProductName + " " + versionString() + kCtcp); return; } } diff --git a/test/test_irc_session/test_irc_session.cpp b/test/test_irc_session/test_irc_session.cpp index 8d7563c..aeed853 100644 --- a/test/test_irc_session/test_irc_session.cpp +++ b/test/test_irc_session/test_irc_session.cpp @@ -5,6 +5,7 @@ #include "../memory_store.h" #include "irc_session.h" +#include "version.h" using namespace roro; @@ -326,7 +327,7 @@ void test_action_and_ctcp_version() { f.take(); f.recv(":alice!u@h PRIVMSG roro :\x01VERSION\x01"); f.take(); - TEST_ASSERT_TRUE(f.sent("NOTICE alice :\x01VERSION roro9stack\x01")); + TEST_ASSERT_TRUE(f.sent(std::string("NOTICE alice :\x01VERSION roro9stack ") + versionString() + "\x01")); } void test_topic_is_kept() {