summaryrefslogtreecommitdiff
path: root/modules/core/cs_modes.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-22 03:16:11 -0400
committerAdam <Adam@anope.org>2011-05-16 04:06:17 -0400
commitc8c23158a4ff74822d6c7d201dc53d879e3d91e8 (patch)
tree4bc9ae029691d5e7c03ebc1481683a010b733844 /modules/core/cs_modes.cpp
parent1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff)
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'modules/core/cs_modes.cpp')
-rw-r--r--modules/core/cs_modes.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/modules/core/cs_modes.cpp b/modules/core/cs_modes.cpp
index 96520b215..eeaf9f733 100644
--- a/modules/core/cs_modes.cpp
+++ b/modules/core/cs_modes.cpp
@@ -12,7 +12,7 @@
/*************************************************************************/
#include "module.h"
-
+#include "chanserv.h"
class CommandModeBase : public Command
{
@@ -76,7 +76,7 @@ class CommandModeBase : public Command
Log(LOG_COMMAND, u, com, ci) << "for " << u2->nick;
if (notice && ci->HasFlag(notice))
- ircdproto->SendMessage(whosends(ci), c->name, "%s command used for %s by %s", com->name.c_str(), u2->nick.c_str(), u->nick.c_str());
+ ircdproto->SendMessage(ci->WhoSends(), c->name, "%s command used for %s by %s", com->name.c_str(), u2->nick.c_str(), u->nick.c_str());
}
}
@@ -462,10 +462,13 @@ class CSModes : public Module
this->SetAuthor("Anope");
this->SetType(CORE);
- this->AddCommand(ChanServ, &commandcsop);
- this->AddCommand(ChanServ, &commandcsdeop);
- this->AddCommand(ChanServ, &commandcsvoice);
- this->AddCommand(ChanServ, &commandcsdevoice);
+ if (!chanserv)
+ throw ModuleException("ChanServ is not loaded!");
+
+ this->AddCommand(chanserv->Bot(), &commandcsop);
+ this->AddCommand(chanserv->Bot(), &commandcsdeop);
+ this->AddCommand(chanserv->Bot(), &commandcsvoice);
+ this->AddCommand(chanserv->Bot(), &commandcsdevoice);
if (Me && Me->IsSynced())
OnUplinkSync(NULL);
@@ -478,31 +481,31 @@ class CSModes : public Module
{
if (ModeManager::FindChannelModeByName(CMODE_OWNER))
{
- this->AddCommand(ChanServ, &commandcsowner);
- this->AddCommand(ChanServ, &commandcsdeowner);
+ this->AddCommand(chanserv->Bot(), &commandcsowner);
+ this->AddCommand(chanserv->Bot(), &commandcsdeowner);
}
if (ModeManager::FindChannelModeByName(CMODE_PROTECT))
{
- this->AddCommand(ChanServ, &commandcsprotect);
- this->AddCommand(ChanServ, &commandcsdeprotect);
+ this->AddCommand(chanserv->Bot(), &commandcsprotect);
+ this->AddCommand(chanserv->Bot(), &commandcsdeprotect);
}
if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
{
- this->AddCommand(ChanServ, &commandcshalfop);
- this->AddCommand(ChanServ, &commandcsdehalfop);
+ this->AddCommand(chanserv->Bot(), &commandcshalfop);
+ this->AddCommand(chanserv->Bot(), &commandcsdehalfop);
}
}
void OnServerDisconnect()
{
- this->DelCommand(ChanServ, &commandcsowner);
- this->DelCommand(ChanServ, &commandcsdeowner);
- this->DelCommand(ChanServ, &commandcsprotect);
- this->DelCommand(ChanServ, &commandcsdeprotect);
- this->DelCommand(ChanServ, &commandcshalfop);
- this->DelCommand(ChanServ, &commandcsdehalfop);
+ this->DelCommand(chanserv->Bot(), &commandcsowner);
+ this->DelCommand(chanserv->Bot(), &commandcsdeowner);
+ this->DelCommand(chanserv->Bot(), &commandcsprotect);
+ this->DelCommand(chanserv->Bot(), &commandcsdeprotect);
+ this->DelCommand(chanserv->Bot(), &commandcshalfop);
+ this->DelCommand(chanserv->Bot(), &commandcsdehalfop);
}
};