summaryrefslogtreecommitdiff
path: root/modules/commands/cs_set_persist.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-11-22 00:50:33 -0500
committerAdam <Adam@anope.org>2012-11-22 00:50:33 -0500
commitd33a0f75a5c0c584fbb7cc0076da36d494f39494 (patch)
tree7b2274cc833c793c0f5595660cbd4d715de52ffd /modules/commands/cs_set_persist.cpp
parent368d469631763e9c8bf399980d0ac7c5b5664d39 (diff)
Pretty large coding style cleanup, in source doc
cleanup, and allow protocol mods to depend on each other
Diffstat (limited to 'modules/commands/cs_set_persist.cpp')
-rw-r--r--modules/commands/cs_set_persist.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/commands/cs_set_persist.cpp b/modules/commands/cs_set_persist.cpp
index bdd3b9004..03e5d3a84 100644
--- a/modules/commands/cs_set_persist.cpp
+++ b/modules/commands/cs_set_persist.cpp
@@ -24,7 +24,7 @@ class CommandCSSetPersist : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
- ChannelInfo *ci = cs_findchan(params[0]);
+ ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
@@ -60,21 +60,19 @@ class CommandCSSetPersist : public Command
ci->bi->Join(c);
}
- /* No botserv bot, no channel mode */
- /* Give them ChanServ
- * Yes, this works fine with no Config->s_BotServ
+ /* No botserv bot, no channel mode, give them ChanServ.
+ * Yes, this works fine with no Config->BotServ.
*/
if (!ci->bi && !cm)
{
- BotInfo *bi = findbot(Config->ChanServ);
- if (!bi)
+ if (!ChanServ)
{
source.Reply(_("ChanServ is required to enable persist on this network."));
return;
}
- bi->Assign(NULL, ci);
- if (!ci->c->FindUser(bi))
- bi->Join(ci->c);
+ ChanServ->Assign(NULL, ci);
+ if (!ci->c->FindUser(ChanServ))
+ ChanServ->Join(ci->c);
}
/* Set the perm mode */
@@ -111,14 +109,13 @@ class CommandCSSetPersist : public Command
*/
if (!cm && Config->BotServ.empty() && ci->bi)
{
- BotInfo *bi = findbot(Config->ChanServ);
- if (!bi)
+ if (!ChanServ)
{
source.Reply(_("ChanServ is required to enable persist on this network."));
return;
}
/* Unassign bot */
- bi->UnAssign(NULL, ci);
+ ChanServ->UnAssign(NULL, ci);
}
}