summaryrefslogtreecommitdiff
path: root/src/modules/m_botmode.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 21:42:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-08 21:42:30 +0000
commitdb07867e945deb72ce103f796e20104a27c5f68a (patch)
treece9520b30f5a55c08d80eea20f43df3f9a073255 /src/modules/m_botmode.cpp
parentf6fc729c7211ac6cc9fca4ef63a710b48ccf2457 (diff)
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
Diffstat (limited to 'src/modules/m_botmode.cpp')
-rw-r--r--src/modules/m_botmode.cpp32
1 files changed, 9 insertions, 23 deletions
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 &parameter, 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 &params)
- {
- 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());
}