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)
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;