summaryrefslogtreecommitdiff
path: root/src/modules/m_botmode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 21:37:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 21:37:16 +0000
commitf6fc729c7211ac6cc9fca4ef63a710b48ccf2457 (patch)
tree15a14e80a78cda35fd3865fe7546e8c2877c7588 /src/modules/m_botmode.cpp
parent07e2a596f05f011adfa58fab25214225e80cb6f4 (diff)
Did some renaming so that the methods for modes in chanrec and userrec are identical.
bool IsModeSet(const unsigned char c); void SetMode(const unsigned char c, bool value); Fixed m_botmode for new api git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4194 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_botmode.cpp')
-rw-r--r--src/modules/m_botmode.cpp25
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 &parameter, 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;