summaryrefslogtreecommitdiff
path: root/modules/commands/cs_updown.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-19 16:03:53 -0500
committerAdam <Adam@anope.org>2012-12-19 16:03:53 -0500
commit276247b463ab0731c1476c94adc247a2934960b3 (patch)
tree8d9b99f32e58e0e580dbcbd0ab4e36867df4dfa8 /modules/commands/cs_updown.cpp
parent67bd2c6b2da0d66dc7874dabbc8c9d2136efeb94 (diff)
Add a command flag to require that a user is executing the command
Diffstat (limited to 'modules/commands/cs_updown.cpp')
-rw-r--r--modules/commands/cs_updown.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/commands/cs_updown.cpp b/modules/commands/cs_updown.cpp
index 6d46c873e..7504c3601 100644
--- a/modules/commands/cs_updown.cpp
+++ b/modules/commands/cs_updown.cpp
@@ -18,6 +18,7 @@ class CommandCSUp : public Command
public:
CommandCSUp(Module *creator) : Command(creator, "chanserv/up", 0, 1)
{
+ this->SetFlag(CFLAG_REQUIRE_USER);
this->SetDesc(_("Updates your status on a channel"));
this->SetSyntax(_("[\037channel\037]"));
}
@@ -25,8 +26,6 @@ class CommandCSUp : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
User *u = source.GetUser();
- if (!u)
- return;
if (params.empty())
for (UChannelList::iterator it = u->chans.begin(); it != u->chans.end(); ++it)
@@ -75,6 +74,7 @@ class CommandCSDown : public Command
public:
CommandCSDown(Module *creator) : Command(creator, "chanserv/down", 0, 1)
{
+ this->SetFlag(CFLAG_REQUIRE_USER);
this->SetDesc(_("Removes your status from a channel"));
this->SetSyntax(_("[\037channel\037]"));
}
@@ -82,8 +82,6 @@ class CommandCSDown : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
User *u = source.GetUser();
- if (!u)
- return;
if (params.empty())
for (UChannelList::iterator it = u->chans.begin(); it != u->chans.end(); ++it)