- 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());
- parameter = "";
- return MODEACTION_DENY;
+ if ((c == channel) || (c->IsModeSet('L')))
+ {
+ source->WriteServ("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 = ServerInstance->chanlist.begin(); i != ServerInstance->chanlist.end(); i++)
+ {
+ if ((i->second != channel) && (i->second->IsModeSet('L')) && (irc::string(i->second->GetModeParameter('L').c_str()) == irc::string(channel->name)))
+ {
+ source->WriteServ("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;
+ }
+ }
+ }