diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_denychans.cpp | 8 |
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; |