From 60052716ae1abea46417fd984e60a1437f0bc256 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 5 May 2004 11:48:37 +0000 Subject: Added support for +L (services doesnt support this yet) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@792 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_redirect.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index 0cdde51c8..aab9e2750 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -21,16 +21,19 @@ class ModuleRedirect : public Module virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) { - if ((modechar == 'L') && (type == MT_CHANNEL)) { - chanrec* c = Srv->Findchannel(params[0]); - if (c) + if (mode_on) { - if (c->IsCustomModeSet('L')) + std::string ChanToJoin = params[0]; + chanrec* c = Srv->FindChannel(ChanToJoin); + if (c) { - WriteServ(user->fd,"690 %s :Circular redirection, mode +L to %s not allowed.",user->nick,params[0].c_str()); - return 0; + if (c->IsCustomModeSet('L')) + { + WriteServ(user->fd,"690 %s :Circular redirection, mode +L to %s not allowed.",user->nick,params[0].c_str()); + return 0; + } } } return 1; @@ -45,9 +48,9 @@ class ModuleRedirect : public Module { if (chan->limit >= Srv->CountUsers(chan)) { - char* channel = chan->GetModeParameter('L'); - WriteServ(user->fd,"470 %s :%s has become full, so you are automatically being transferred to the linked channel %s",user->nick,cname,channel); - Srv->JoinUserToChannel(user,channel,""); + std::string channel = chan->GetModeParameter('L'); + WriteServ(user->fd,"470 %s :%s has become full, so you are automatically being transferred to the linked channel %s",user->nick,cname,channel.c_str()); + Srv->JoinUserToChannel(user,channel.c_str(),""); return 1; } } -- cgit v1.2.3