summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-07 22:09:17 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-07 22:09:17 +0000
commit6353036b7c46a5d47929f02957eed24aad3c2be7 (patch)
tree94547a850c06c4d5a3007a959916d5dbcde73413 /src
parent88a34791f00407f9c85f30db3634f09ebd2e79b5 (diff)
Now with added ANGRY MONKEYS.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4777 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_redirect.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 8abb7a77e..8d2d152c2 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -24,6 +24,8 @@ using namespace std;
/* $ModDesc: Provides channel mode +L (limit redirection) */
+extern chan_hash chanlist;
+
class Redirect : public ModeHandler
{
Server* Srv;
@@ -63,10 +65,21 @@ class Redirect : public ModeHandler
/* Fix by brain: Dont let a channel be linked to *itself* either */
if ((c == channel) || (c->IsModeSet('L')))
{
- WriteServ(source->fd,"690 %s :Circular or chained +L to %s not allowed. Pack of wild dogs has been unleashed.",source->nick,parameter.c_str());
+ WriteServ(source->fd,"690 %s :Circular or chained +L to %s not allowed (Channel already has +L). Pack of wild dogs has been unleashed.",source->nick,parameter.c_str());
parameter = "";
return MODEACTION_DENY;
}
+ else
+ {
+ for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++)
+ {
+ if ((i->second != channel) && (i->second->IsModeSet('L')) && (irc::string(i->second->GetModeParameter('L').c_str()) == irc::string(channel->name)))
+ {
+ WriteServ(source->fd,"690 %s :Circular or chained +L to %s not allowed (Already forwarded here from %s). Angry monkeys dispatched.",source->nick,parameter.c_str(),i->second->name);
+ return MODEACTION_DENY;
+ }
+ }
+ }
}
channel->SetMode('L', true);