]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Improve reading xlines from the server configuration.
[user/henk/code/inspircd.git] / src / configreader.cpp
index 0318dd602cb9f071dd9ca5a09369117046e6f23e..782a80080aad8e9e83cc4e741ce557c30733ad01 100644 (file)
@@ -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))