]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_denychans.cpp
Merge pull request #495 from SaberUK/master+fix-libcpp
[user/henk/code/inspircd.git] / src / modules / m_denychans.cpp
index 50c70999dc32e52728461285b13b2ec22b49b5c7..b97c74f9b0bc4e7d49dcb3f6fc35c181524c51fc 100644 (file)
@@ -45,7 +45,7 @@ class ModuleDenyChannels : public Module
                        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());
@@ -83,14 +83,14 @@ class ModuleDenyChannels : public Module
        }
 
 
-       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;
                                }
@@ -115,7 +115,7 @@ class ModuleDenyChannels : public Module
                                                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;
                                                }
                                        }