Support all allowed channel prefixes

RFC 2812 specifies in §1.3 that “Channels names are strings (beginning
with a '&', '#', '+' or '!' character) of length up to fifty (50)
characters.”

We previously only allowed the first two prefix characters, or any other
one if the server overrides the list with ISUPPORT.
This commit is contained in:
Link Mauve authored and Link Mauve committed 2025-07-29 16:04:36 +02:00
1 parent e4d32f9392
commit 7cd4e06f84
6 files changed
+13 -12

No files matched your search

+2 -2
View File
@@ -47,7 +47,7 @@ namespace Catch
TEST_CASE("Iid creation")
{
const std::set<char> chantypes {'#', '&'};
const std::set<char> chantypes {'&', '#', '+', '!'};
Iid iid1("foo%irc.example.org", chantypes);
CHECK(std::to_string(iid1) == "foo%irc.example.org");
CHECK(iid1.get_local() == "foo");
@@ -95,7 +95,7 @@ TEST_CASE("Iid creation in fixed_server mode")
{
Config::set("fixed_irc_server", "fixed.example.com", false);
const std::set<char> chantypes {'#', '&'};
const std::set<char> chantypes {'&', '#', '+', '!'};
Iid iid1("foo%irc.example.org", chantypes);
CHECK(std::to_string(iid1) == "foo%irc.example.org");
CHECK(iid1.get_local() == "foo%irc.example.org");