summaryrefslogtreecommitdiff
path: root/modules/commands/ns_identify.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
committerAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
commit2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch)
tree36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/ns_identify.cpp
parent873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff)
Allow userless command sources
Diffstat (limited to 'modules/commands/ns_identify.cpp')
-rw-r--r--modules/commands/ns_identify.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/commands/ns_identify.cpp b/modules/commands/ns_identify.cpp
index cd0b14ddb..9fbe46f6b 100644
--- a/modules/commands/ns_identify.cpp
+++ b/modules/commands/ns_identify.cpp
@@ -25,7 +25,10 @@ class CommandNSIdentify : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
- User *u = source.u;
+ User *u = source.GetUser();
+
+ if (!u)
+ return;
const Anope::string &nick = params.size() == 2 ? params[0] : u->nick;
Anope::string pass = params[params.size() - 1];
@@ -46,16 +49,16 @@ class CommandNSIdentify : public Command
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
else if (MOD_RESULT != EVENT_ALLOW)
{
- Log(LOG_COMMAND, u, this) << "and failed to identify";
+ Log(LOG_COMMAND, source, this) << "and failed to identify";
source.Reply(PASSWORD_INCORRECT);
bad_password(u);
}
else
{
if (u->IsIdentified())
- Log(LOG_COMMAND, u, this) << "to log out of account " << u->Account()->display;
+ Log(LOG_COMMAND, source, this) << "to log out of account " << u->Account()->display;
- Log(LOG_COMMAND, u, this) << "and identified for account " << na->nc->display;
+ Log(LOG_COMMAND, source, this) << "and identified for account " << na->nc->display;
source.Reply(_("Password accepted - you are now recognized."));
u->Identify(na);
}