summaryrefslogtreecommitdiff
path: root/src/modules/m_denychans.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-10 18:23:03 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-02-10 18:23:03 +0000
commit5d09cbf63475851d6aaa7035d97787727ba456da (patch)
tree29ba9dcc997a9b45a229dd3c16690a3314fe0f3e /src/modules/m_denychans.cpp
parent8e7fceba881712e481545d8908b1d6492bb5e5e5 (diff)
Add <badchan:redirect>: 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
Diffstat (limited to 'src/modules/m_denychans.cpp')
-rw-r--r--src/modules/m_denychans.cpp8
1 files changed, 8 insertions, 0 deletions
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;