summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 92991e38b..887967626 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -18,7 +18,7 @@
#include "regchannel.h"
#include "channels.h"
-static const Anope::string CommandFlagString[] = { "CFLAG_ALLOW_UNREGISTERED", "CFLAG_STRIP_CHANNEL", "" };
+static const Anope::string CommandFlagString[] = { "CFLAG_ALLOW_UNREGISTERED", "CFLAG_STRIP_CHANNEL", "CFLAG_REQUIRE_USER", "" };
template<> const Anope::string* Flags<CommandFlag>::flags_strings = CommandFlagString;
CommandSource::CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *r, BotInfo *bi) : nick(n), u(user), nc(core), reply(r),
@@ -218,6 +218,9 @@ void RunCommand(CommandSource &source, const Anope::string &message)
return;
}
+ if (c->HasFlag(CFLAG_REQUIRE_USER) && !source.GetUser())
+ return;
+
// Command requires registered users only
if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !source.nc)
{