if (!redirect.empty())
{
- if (!ServerInstance->IsChannel(redirect.c_str(), ServerInstance->Config->Limits.ChanMax))
+ if (!ServerInstance->IsChannel(redirect, ServerInstance->Config->Limits.ChanMax))
{
if (user)
user->WriteServ("NOTICE %s :Invalid badchan redirect '%s'", user->nick.c_str(), redirect.c_str());
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
+ ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
ConfigTagList tags = ServerInstance->Config->ConfTags("badchan");
for (ConfigIter j = tags.first; j != tags.second; ++j)
{
if (InspIRCd::Match(cname, j->second->getString("name")))
{
- if (IS_OPER(user) && j->second->getBool("allowopers"))
+ if (user->IsOper() && j->second->getBool("allowopers"))
{
return MOD_RES_PASSTHRU;
}
if ((!newchan) || (!(newchan->IsModeSet('L'))))
{
user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),redirect.c_str(), reason.c_str());
- Channel::JoinUser(user, redirect, false, "", false, ServerInstance->Time());
+ Channel::JoinUser(user, redirect);
return MOD_RES_DENY;
}
}