diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index cff625c46..fd25a9a9f 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -162,11 +162,20 @@ void ModeWatcher::AfterMode(User*, User*, Channel*, const std::string&, bool) PrefixMode::PrefixMode(Module* Creator, const std::string& Name, char ModeLetter, unsigned int Rank, char PrefixChar) : ModeHandler(Creator, Name, ModeLetter, PARAM_ALWAYS, MODETYPE_CHANNEL, MC_PREFIX) - , prefix(PrefixChar), prefixrank(Rank) + , prefix(PrefixChar) + , prefixrank(Rank) + , selfremove(true) { list = true; } +ModResult PrefixMode::AccessCheck(User* src, Channel*, std::string& value, bool adding) +{ + if (!adding && src->nick == value && selfremove) + return MOD_RES_ALLOW; + return MOD_RES_PASSTHRU; +} + ModeAction PrefixMode::OnModeChange(User* source, User*, Channel* chan, std::string& parameter, bool adding) { User* target; |