]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Improve consistency of the restrictchans module example config.
[user/henk/code/inspircd.git] / src / channels.cpp
index c9816db4b006795fc0dde9faef88ade67a6d07b7..e5fd7265effa1a2041c10ac51fbd0fdb542fd54f 100644 (file)
@@ -40,7 +40,8 @@ Channel::Channel(const std::string &cname, time_t ts)
 
 void Channel::SetMode(ModeHandler* mh, bool on)
 {
-       modes[mh->GetId()] = on;
+       if (mh && mh->GetId() != ModeParser::MODEID_MAX)
+               modes[mh->GetId()] = on;
 }
 
 void Channel::SetTopic(User* u, const std::string& ntopic, time_t topicts, const std::string* setter)
@@ -177,7 +178,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co
                unsigned int maxchans = user->GetClass()->maxchans;
                if (user->IsOper())
                {
-                       unsigned int opermaxchans = ConvToInt(user->oper->getConfig("maxchans"));
+                       unsigned int opermaxchans = ConvToNum<unsigned int>(user->oper->getConfig("maxchans"));
                        // If not set, use 2.0's <channels:opers>, if that's not set either, use limit from CC
                        if (!opermaxchans && user->HasPrivPermission("channels/high-join-limit"))
                                opermaxchans = ServerInstance->Config->OperMaxChans;