From 586abc72dab240bc9e4d6bfd60a53a26f0811422 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 15 Nov 2019 11:33:09 +0000 Subject: Improve reading xlines from the server configuration. --- src/configreader.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 0318dd602..782a80080 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -80,11 +80,16 @@ static void ReadXLine(ServerConfig* conf, const std::string& tag, const std::str for(ConfigIter i = tags.first; i != tags.second; ++i) { ConfigTag* ctag = i->second; - std::string mask; - if (!ctag->readString(key, mask)) - throw CoreException("<"+tag+":"+key+"> missing at " + ctag->getTagLocation()); - std::string reason = ctag->getString("reason", ""); - XLine* xl = make->Generate(ServerInstance->Time(), 0, "", reason, mask); + + const std::string mask = ctag->getString(key); + if (mask.empty()) + throw CoreException("<" + tag + ":" + key + "> missing at " + ctag->getTagLocation()); + + const std::string reason = ctag->getString("reason"); + if (reason.empty()) + throw CoreException("<" + tag + ":reason> missing at " + ctag->getTagLocation()); + + XLine* xl = make->Generate(ServerInstance->Time(), 0, ServerInstance->Config->ServerName, reason, mask); xl->from_config = true; configlines.insert(xl->Displayable()); if (!ServerInstance->XLines->AddLine(xl, NULL)) -- cgit v1.3.1-10-gc9f91 From 43da9c32321aafb29a82e98a06bc0e139bb3864d Mon Sep 17 00:00:00 2001 From: Matt Schatz Date: Sun, 17 Nov 2019 05:06:33 -0700 Subject: Allow options:casemapping to remain defined when using m_nationalchars. --- src/configreader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 782a80080..2a1da8fd8 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -368,7 +368,8 @@ void ServerConfig::Fill() throw CoreException("You must restart to change the server id"); std::string casemapping = options->getString("casemapping"); - if (!casemapping.empty() && casemapping != CaseMapping) + // Ignore this value if CaseMapping is set to something the core doesn't provide (i.e., m_nationalchars). + if (!casemapping.empty() && casemapping != CaseMapping && (CaseMapping == "ascii" || CaseMapping == "rfc1459")) throw CoreException("You must restart to change the server casemapping"); } -- cgit v1.3.1-10-gc9f91