- void Implements(char* List)
- {
- List[I_On005Numeric] = List[I_OnUserPreJoin] = List[I_OnExtendedMode] = 1;
- }
-
- virtual void On005Numeric(std::string &output)
- {
- InsertMode(output, "L", 3);
- }
-
- virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
- {
- if (chan)
- {
- if (chan->IsModeSet('L'))
- {
- if (Srv->CountUsers(chan) >= chan->limit)
- {
- 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;
+ if (user->IsModeSet(antiredirectmode))
+ {
+ user->WriteNumeric(470, cname, channel, "Force redirection stopped.");
+ return MOD_RES_DENY;
+ }
+ else
+ {
+ user->WriteNumeric(470, cname, channel, "You may not join this channel, so you are automatically being transferred to the redirected channel.");
+ Channel::JoinUser(user, channel);
+ return MOD_RES_DENY;
+ }