summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-11-15 11:33:09 +0000
committerPeter Powell <petpow@saberuk.com>2019-11-16 22:05:42 +0000
commit586abc72dab240bc9e4d6bfd60a53a26f0811422 (patch)
tree7e6ed17c3ab5a57310214f4934745571fa822116 /src
parente8b476bea986691e10f69b93343dd3f578fb00fb (diff)
Improve reading xlines from the server configuration.
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp15
1 files changed, 10 insertions, 5 deletions
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", "<Config>");
- XLine* xl = make->Generate(ServerInstance->Time(), 0, "<Config>", 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))