oper = true;
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE
{
if (adding == channel->IsModeSet(this))
return MODEACTION_DENY;
std::string channel = tag->getString("channel");
std::string modes = tag->getString("modes");
- if ((channel.empty()) || (channel.length() > ServerInstance->Config->Limits.ChanMax))
+ if (!ServerInstance->IsChannel(channel))
{
- ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Ignoring permchannels tag with empty or too long channel name (\"" + channel + "\")");
+ ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Ignoring permchannels tag with invalid channel name (\"" + channel + "\")");
continue;
}
time_t TS = tag->getInt("ts", ServerInstance->Time(), 1);
c = new Channel(channel, TS);
- unsigned int topicset = tag->getInt("topicts");
+ time_t topicset = tag->getInt("topicts", 0);
std::string topic = tag->getString("topic");
if ((topicset != 0) || (!topic.empty()))
ModeHandler* mode = ServerInstance->Modes->FindMode(*n, MODETYPE_CHANNEL);
if (mode)
{
- if (mode->GetNumParams(true))
+ if (mode->NeedsParam(true))
list.GetToken(par);
else
par.clear();
mode->OnModeChange(ServerInstance->FakeClient, ServerInstance->FakeClient, c, par, true);
}
}
+
+ // We always apply the permchannels mode to permanent channels.
+ par.clear();
+ p.OnModeChange(ServerInstance->FakeClient, ServerInstance->FakeClient, c, par, true);
}
}
}
dirty = false;
}
- void Prioritize()
+ void Prioritize() CXX11_OVERRIDE
{
// XXX: Load the DB here because the order in which modules are init()ed at boot is
// alphabetical, this means we must wait until all modules have done their init()
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides support for channel mode +P to provide permanent channels",VF_VENDOR);
+ return Version("Provides channel mode +P to provide permanent channels", VF_VENDOR);
}
ModResult OnChannelPreDelete(Channel *c) CXX11_OVERRIDE