join channels that we're announcing to

This commit is contained in:
2025-02-03 11:05:01 -08:00
parent 44ef4c0689
commit 4fc8d4d49c
5 changed files with 37 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
add_custom_command(
OUTPUT irc_commands.inc
COMMAND
/opt/homebrew/bin/gperf
gperf
-C -Z IrcCommandHash -K text -L C++ -t
--output-file irc_commands.inc
${CMAKE_CURRENT_SOURCE_DIR}/irc_commands.gperf

View File

@@ -239,6 +239,11 @@ auto Client::is_channel(std::string_view name) const -> bool
return not name.empty() && channel_prefix_.find(name[0]) != channel_prefix_.npos;
}
auto Client::is_on_channel(std::string_view name) const -> bool
{
return channels_.contains(casemap(name));
}
namespace {
template <class... Ts>
struct overloaded : Ts...

View File

@@ -102,6 +102,7 @@ public:
auto is_my_nick(std::string_view nick) const -> bool;
auto is_my_mask(std::string_view mask) const -> bool;
auto is_channel(std::string_view name) const -> bool;
auto is_on_channel(std::string_view name) const -> bool;
auto casemap(std::string_view) const -> std::string;
auto casemap_compare(std::string_view, std::string_view) const -> int;