summaryrefslogtreecommitdiff
path: root/modules/core/cs_forbid.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-24 21:40:56 -0600
committerAdam <Adam@anope.org>2010-12-12 19:36:19 -0500
commitcb6ef574e3df5cc846247450b74ca37d265f319e (patch)
tree8ce3374a537c312af63c78125bfea4622bb188f0 /modules/core/cs_forbid.cpp
parent37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff)
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'modules/core/cs_forbid.cpp')
-rw-r--r--modules/core/cs_forbid.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/core/cs_forbid.cpp b/modules/core/cs_forbid.cpp
index 14f35b57c..669f6f5e7 100644
--- a/modules/core/cs_forbid.cpp
+++ b/modules/core/cs_forbid.cpp
@@ -21,13 +21,13 @@ class CommandCSForbid : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL);
}
- CommandReturn Execute(User *u, const std::vector<Anope::string> &params)
+ CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
- ChannelInfo *ci;
- Anope::string chan = params[0];
- Anope::string reason = params.size() > 1 ? params[1] : "";
+ const Anope::string &chan = params[0];
+ const Anope::string &reason = params.size() > 1 ? params[1] : "";
- Channel *c;
+ User *u = source.u;
+ ChannelInfo *ci = source.ci;
if (Config->ForceForbidReason && reason.empty())
{
@@ -37,13 +37,13 @@ class CommandCSForbid : public Command
if (chan[0] != '#')
{
- u->SendMessage(ChanServ, CHAN_SYMBOL_REQUIRED);
+ source.Reply(CHAN_SYMBOL_REQUIRED);
return MOD_CONT;
}
if (readonly)
{
- u->SendMessage(ChanServ, READ_ONLY_MODE);
+ source.Reply(READ_ONLY_MODE);
return MOD_CONT;
}
@@ -55,7 +55,8 @@ class CommandCSForbid : public Command
ci->forbidby = u->nick;
ci->forbidreason = reason;
- if ((c = ci->c))
+ Channel *c = ci->c;
+ if (c)
{
/* Before banning everyone, it might be prudent to clear +e and +I lists..
* to prevent ppl from rejoining.. ~ Viper */