From db07867e945deb72ce103f796e20104a27c5f68a Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 8 Jul 2006 21:42:30 +0000 Subject: Fix all typos (not as fun as 'kill all humans' but meh, beggers cant be choosers) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4195 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_botmode.cpp | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index d5757c002..fa79c83f6 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -26,6 +26,7 @@ using namespace std; class BotMode : public ModeHandler { + public: BotMode() : ModeHandler('B', 0, 0, false, MODETYPE_USER, false) { } ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) @@ -34,7 +35,7 @@ class BotMode : public ModeHandler { if (!dest->IsModeSet('B')) { - user->SetMode('B',true); + dest->SetMode('B',true); return MODEACTION_ALLOW; } } @@ -42,7 +43,7 @@ class BotMode : public ModeHandler { if (dest->IsModeSet('B')) { - user->SetMode('B',false); + dest->SetMode('B',false); return MODEACTION_ALLOW; } } @@ -51,23 +52,20 @@ class BotMode : public ModeHandler class ModuleBotMode : public Module { - Server *Srv; + Server *Srv; + BotMode* bm; public: ModuleBotMode(Server* Me) : Module::Module(Me) { Srv = Me; - - if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0)) - { - Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!"); - return; - } + bm = new BotMode(); + Srv->AddMode(bm, 'B'); } void Implements(char* List) { - List[I_OnWhois] = List[I_OnExtendedMode] = 1; + List[I_OnWhois] = 1; } virtual ~ModuleBotMode() @@ -78,22 +76,10 @@ class ModuleBotMode : public Module { return Version(1,0,0,0,VF_STATIC|VF_VENDOR); } - - virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) - { - if ((modechar == 'B') && (type == MT_CLIENT)) - { - return 1; - } - else - { - return 0; - } - } virtual void OnWhois(userrec* src, userrec* dst) { - if (dst->modes['B'-65]) + if (dst->IsModeSet('B')) { Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName()); } -- cgit v1.2.3