- virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
- {
- if ((modechar == 'L') && (type == MT_CHANNEL))
- {
- if (mode_on)
- {
- std::string ChanToJoin = params[0];
- chanrec *c;
-
- if (!IsValidChannelName(ChanToJoin.c_str()))
- {
- WriteServ(user->fd,"403 %s %s :Invalid channel name",user->nick, ChanToJoin.c_str());
- return 0;
- }
-
- c = Srv->FindChannel(ChanToJoin);
- if (c)
- {
- /* Fix by brain: Dont let a channel be linked to *itself* either */
- if ((c == target) || (c->IsModeSet('L')))
- {
- WriteServ(user->fd,"690 %s :Circular redirection, mode +L to %s not allowed.",user->nick,params[0].c_str());
- return 0;
- }
- }
- }
- return 1;
- }
- return 0;
- }
-