]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configreader.cpp
Replace most usages of "GECOS" with "real" or "real name".
[user/henk/code/inspircd.git] / src / configreader.cpp
index b5d6b3ecb651a4500eed084aad781434ab01f06d..52d349f5cac46166b1e32f59c1649336955bea3d 100644 (file)
@@ -37,7 +37,7 @@ ServerLimits::ServerLimits(ConfigTag* tag)
        , MaxQuit(tag->getUInt("maxquit", 255))
        , MaxTopic(tag->getUInt("maxtopic", 307))
        , MaxKick(tag->getUInt("maxkick", 255))
-       , MaxGecos(tag->getUInt("maxgecos", 128))
+       , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128)))
        , MaxAway(tag->getUInt("maxaway", 200))
        , MaxLine(tag->getUInt("maxline", 512))
        , MaxHost(tag->getUInt("maxhost", 64))
@@ -72,26 +72,6 @@ ServerConfig::~ServerConfig()
        delete EmptyTag;
 }
 
-static void ValidHost(const std::string& p, const std::string& msg)
-{
-       int num_dots = 0;
-       if (p.empty() || p[0] == '.')
-               throw CoreException("The value of "+msg+" is not a valid hostname");
-       for (unsigned int i=0;i < p.length();i++)
-       {
-               switch (p[i])
-               {
-                       case ' ':
-                               throw CoreException("The value of "+msg+" is not a valid hostname");
-                       case '.':
-                               num_dots++;
-                       break;
-               }
-       }
-       if (num_dots == 0)
-               throw CoreException("The value of "+msg+" is not a valid hostname");
-}
-
 bool ServerConfig::ApplyDisabledCommands()
 {
        // Enable everything first.
@@ -389,8 +369,7 @@ void ServerConfig::Fill()
        ConfigTag* server = ConfValue("server");
        if (sid.empty())
        {
-               ServerName = server->getString("name", "irc.example.com");
-               ValidHost(ServerName, "<server:name>");
+               ServerName = server->getString("name", "irc.example.com", InspIRCd::IsHost);
 
                sid = server->getString("id");
                if (!sid.empty() && !InspIRCd::IsSID(sid))