From 2dec8e767a70def4b9b04a96ae4f75e4d1013038 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 18 Jun 2012 05:04:30 -0400 Subject: Allow userless command sources --- modules/commands/ns_sendpass.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules/commands/ns_sendpass.cpp') diff --git a/modules/commands/ns_sendpass.cpp b/modules/commands/ns_sendpass.cpp index deff5419c..6b2b2533b 100644 --- a/modules/commands/ns_sendpass.cpp +++ b/modules/commands/ns_sendpass.cpp @@ -27,11 +27,10 @@ class CommandNSSendPass : public Command void Execute(CommandSource &source, const std::vector ¶ms) anope_override { - User *u = source.u; const Anope::string &nick = params[0]; const NickAlias *na; - if (Config->RestrictMail && (!u->Account() || !u->HasCommand("nickserv/sendpass"))) + if (Config->RestrictMail && !source.HasCommand("nickserv/sendpass")) source.Reply(ACCESS_DENIED); else if (!(na = findnick(nick))) source.Reply(NICK_X_NOT_REGISTERED, nick.c_str()); @@ -40,9 +39,9 @@ class CommandNSSendPass : public Command Anope::string tmp_pass; if (enc_decrypt(na->nc->pass, tmp_pass) == 1) { - if (SendPassMail(u, na, source.owner, tmp_pass)) + if (SendPassMail(source.GetUser(), na, source.owner, tmp_pass)) { - Log(Config->RestrictMail ? LOG_ADMIN : LOG_COMMAND, u, this) << "for " << na->nick; + Log(Config->RestrictMail ? LOG_ADMIN : LOG_COMMAND, source, this) << "for " << na->nick; source.Reply(_("Password of \002%s\002 has been sent."), nick.c_str()); } } -- cgit