- // Taking the mode off, we need to clean up.
- chanrec* c = (chanrec*)target;
-
- delaylist* dl = (delaylist*)c->GetExt("norejoinusers");
-
- if(dl)
+ delete dl;
+ channel->Shrink("norejoinusers");
+ }
+
+ if (!channel->IsModeSet('J'))
+ {
+ return MODEACTION_DENY;
+ }
+ else
+ {
+ channel->SetMode('J', false);
+ return MODEACTION_ALLOW;
+ }
+ }
+ else if (atoi(parameter.c_str()) > 0)
+ {
+ if (!channel->IsModeSet('J'))
+ {
+ parameter = ConvToStr(atoi(parameter.c_str()));
+ channel->SetModeParam('J', parameter.c_str(), adding);
+ channel->SetMode('J', adding);
+ return MODEACTION_ALLOW;
+ }
+ else
+ {
+ std::string cur_param = channel->GetModeParameter('J');
+ if (cur_param == parameter)