summaryrefslogtreecommitdiff
path: root/src/modules/m_redirect.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-05 11:48:37 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-05 11:48:37 +0000
commit60052716ae1abea46417fd984e60a1437f0bc256 (patch)
tree27ab42b0021ebda9a429898df50924fc02786332 /src/modules/m_redirect.cpp
parent7b0f9d5fbd9b83c2473aaff591d32d7c9024de4e (diff)
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
Diffstat (limited to 'src/modules/m_redirect.cpp')
-rw-r--r--src/modules/m_redirect.cpp21
1 files 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 &params)
{
-
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;
}
}