diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index fb154d5e2..e9635364e 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -176,6 +176,25 @@ ModeAction SimpleChannelModeHandler::OnModeChange(User* source, User* dest, Chan return MODEACTION_DENY; } +ModeAction ParamChannelModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) +{ + if (adding && !ParamValidate(parameter)) + return MODEACTION_DENY; + std::string now = channel->GetModeParameter(this); + if (parameter == now) + return MODEACTION_DENY; + if (adding) + channel->SetModeParam(this, parameter); + else + channel->SetModeParam(this, ""); + return MODEACTION_ALLOW; +} + +bool ParamChannelModeHandler::ParamValidate(std::string& parameter) +{ + return true; +} + ModeWatcher::ModeWatcher(Module* Creator, char modeletter, ModeType type) : mode(modeletter), m_type(type), creator(Creator) { |