diff options
Diffstat (limited to 'src/modules/m_botmode.cpp')
-rw-r--r-- | src/modules/m_botmode.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 612eb3b9c..d5757c002 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -24,6 +24,31 @@ using namespace std; /* $ModDesc: Provides support for unreal-style umode +B */ +class BotMode : public ModeHandler +{ + BotMode() : ModeHandler('B', 0, 0, false, MODETYPE_USER, false) { } + + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) + { + if (adding) + { + if (!dest->IsModeSet('B')) + { + user->SetMode('B',true); + return MODEACTION_ALLOW; + } + } + else + { + if (dest->IsModeSet('B')) + { + user->SetMode('B',false); + return MODEACTION_ALLOW; + } + } + } +}; + class ModuleBotMode : public Module { Server *Srv; |