From cc06429a6923d05cf0da262a1d5af6a2adcc7488 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Sun, 26 Jan 2025 19:43:17 -0800 Subject: [PATCH] fix oper tag --- bot.cpp | 10 ++++------ registration.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bot.cpp b/bot.cpp index 824f249..157fdf4 100644 --- a/bot.cpp +++ b/bot.cpp @@ -6,9 +6,7 @@ auto Bot::start(std::shared_ptr self) -> std::shared_ptr { const auto thread = std::make_shared(std::move(self)); - auto &connection = *thread->self_->get_connection(); - - connection.sig_ircmsg.connect([thread](auto cmd, auto &msg) { + thread->self_->get_connection()->sig_ircmsg.connect([thread](const auto cmd, auto &msg) { thread->on_ircmsg(cmd, msg); }); @@ -25,7 +23,7 @@ auto Bot::process_command(std::string_view message, const IrcMsg &msg) -> void message = message.substr(1); // discard the prefix auto cmdend = message.find(' '); - + std::string_view command = cmdend == message.npos ? message : message.substr(0, cmdend); @@ -40,7 +38,7 @@ auto Bot::process_command(std::string_view message, const IrcMsg &msg) -> void { account = value; } - else if (key == "operator") + else if (key == "solanum.chat/oper") { oper = value; } @@ -56,7 +54,7 @@ auto Bot::process_command(std::string_view message, const IrcMsg &msg) -> void }); } -auto Bot::on_ircmsg(IrcCommand cmd, const IrcMsg &msg) -> void +auto Bot::on_ircmsg(const IrcCommand cmd, const IrcMsg &msg) -> void { if (cmd == IrcCommand::PRIVMSG) { diff --git a/registration.hpp b/registration.hpp index ce5746b..1b3c3b8 100644 --- a/registration.hpp +++ b/registration.hpp @@ -30,14 +30,14 @@ class Registration : public std::enable_shared_from_this public: Registration( - Connection &connection_, + Connection &, const Settings &, - std::shared_ptr self + std::shared_ptr ); static auto start( - Connection &connection, + Connection &, const Settings &, - std::shared_ptr self + std::shared_ptr ) -> std::shared_ptr; };