Public Access
IRC: add the firmware version to the CTCP VERSION reply
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
#include "base64.h"
|
#include "base64.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
namespace roro {
|
namespace roro {
|
||||||
|
|
||||||
@@ -284,7 +285,7 @@ void IrcSession::onPrivmsg(const IrcMessage& m, int64_t utc, bool notice) {
|
|||||||
action = true;
|
action = true;
|
||||||
text = rest;
|
text = rest;
|
||||||
} else {
|
} 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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "../memory_store.h"
|
#include "../memory_store.h"
|
||||||
#include "irc_session.h"
|
#include "irc_session.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
using namespace roro;
|
using namespace roro;
|
||||||
|
|
||||||
@@ -326,7 +327,7 @@ void test_action_and_ctcp_version() {
|
|||||||
f.take();
|
f.take();
|
||||||
f.recv(":alice!u@h PRIVMSG roro :\x01VERSION\x01");
|
f.recv(":alice!u@h PRIVMSG roro :\x01VERSION\x01");
|
||||||
f.take();
|
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() {
|
void test_topic_is_kept() {
|
||||||
|
|||||||
Reference in New Issue
Block a user