summaryrefslogtreecommitdiff
path: root/modules/core/cs_set_persist.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_set_persist.cpp
parent1782ce260c5bc214ec0b2e39257ab1371b68ae9c (diff)
Moved the core pseudo clients out into their own modules
Diffstat (limited to 'modules/core/cs_set_persist.cpp')
-rw-r--r--modules/core/cs_set_persist.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp
index 291203ea2..683bd4481 100644
--- a/modules/core/cs_set_persist.cpp
+++ b/modules/core/cs_set_persist.cpp
@@ -12,6 +12,7 @@
/*************************************************************************/
#include "module.h"
+#include "chanserv.h"
class CommandCSSetPersist : public Command
{
@@ -51,9 +52,9 @@ class CommandCSSetPersist : public Command
*/
if (!ci->bi && !cm)
{
- ChanServ->Assign(NULL, ci);
- if (!ci->c->FindUser(ChanServ))
- ChanServ->Join(ci->c);
+ chanserv->Bot()->Assign(NULL, ci);
+ if (!ci->c->FindUser(chanserv->Bot()))
+ chanserv->Bot()->Join(ci->c);
}
/* Set the perm mode */
@@ -90,7 +91,7 @@ class CommandCSSetPersist : public Command
*/
if (!cm && Config->s_BotServ.empty() && ci->bi)
/* Unassign bot */
- ChanServ->UnAssign(NULL, ci);
+ chanserv->Bot()->UnAssign(NULL, ci);
}
source.Reply(_("Channel \002%s\002 is no longer persistant."), ci->name.c_str());
@@ -156,22 +157,25 @@ class CSSetPersist : public Module
this->SetAuthor("Anope");
this->SetType(CORE);
- Command *c = FindCommand(ChanServ, "SET");
+ if (!chanserv)
+ throw ModuleException("ChanServ is not loaded!");
+
+ Command *c = FindCommand(chanserv->Bot(), "SET");
if (c)
c->AddSubcommand(this, &commandcssetpeace);
- c = FindCommand(ChanServ, "SASET");
+ c = FindCommand(chanserv->Bot(), "SASET");
if (c)
c->AddSubcommand(this, &commandcssasetpeace);
}
~CSSetPersist()
{
- Command *c = FindCommand(ChanServ, "SET");
+ Command *c = FindCommand(chanserv->Bot(), "SET");
if (c)
c->DelSubcommand(&commandcssetpeace);
- c = FindCommand(ChanServ, "SASET");
+ c = FindCommand(chanserv->Bot(), "SASET");
if (c)
c->DelSubcommand(&commandcssasetpeace);
}