From 5d09cbf63475851d6aaa7035d97787727ba456da Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 10 Feb 2008 18:23:03 +0000 Subject: Add : redirects users attempting to join a bad channel to a second channel. Contributed by dz. (thanks) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8881 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_denychans.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp index 7daf225ca..2605bcec2 100644 --- a/src/modules/m_denychans.cpp +++ b/src/modules/m_denychans.cpp @@ -62,6 +62,7 @@ class ModuleDenyChannels : public Module else { std::string reason = Conf->ReadValue("badchan","reason",j); + std::string redirect = Conf->ReadValue("badchan","redirect",j); for (int j = 0; j < Conf->Enumerate("goodchan"); j++) { @@ -70,6 +71,13 @@ class ModuleDenyChannels : public Module return 0; } } + + if (ServerInstance->IsChannel(redirect.c_str())) + { + user->writeserv("926 %s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick,cname,cname,redirect.c_str(), reason.c_str()); + Channel::JoinUser(ServerInstance,user,redirect.c_str(),false,"",false,ServerInstance->Time(true)); + return 1; + } user->WriteServ("926 %s %s :Channel %s is forbidden: %s",user->nick,cname,cname,reason.c_str()); return 1; -- cgit v1.2.3