diff options
author | Adam <Adam@anope.org> | 2010-11-24 21:40:56 -0600 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:36:19 -0500 |
commit | cb6ef574e3df5cc846247450b74ca37d265f319e (patch) | |
tree | 8ce3374a537c312af63c78125bfea4622bb188f0 /modules/core/ns_resetpass.cpp | |
parent | 37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff) |
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'modules/core/ns_resetpass.cpp')
-rw-r--r-- | modules/core/ns_resetpass.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/core/ns_resetpass.cpp b/modules/core/ns_resetpass.cpp index 1c23c5010..ddff616a3 100644 --- a/modules/core/ns_resetpass.cpp +++ b/modules/core/ns_resetpass.cpp @@ -23,22 +23,23 @@ class CommandNSResetPass : public Command this->SetFlag(CFLAG_ALLOW_UNREGISTERED); } - CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) + CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) { + User *u = source.u; NickAlias *na; if (Config->RestrictMail && (!u->Account() || !u->Account()->HasCommand("nickserv/resetpass"))) - u->SendMessage(NickServ, ACCESS_DENIED); + source.Reply(ACCESS_DENIED); if (!(na = findnick(params[0]))) - u->SendMessage(NickServ, NICK_X_NOT_REGISTERED, params[0].c_str()); + source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str()); else if (na->HasFlag(NS_FORBIDDEN)) - u->SendMessage(NickServ, NICK_X_FORBIDDEN, na->nick.c_str()); + source.Reply(NICK_X_FORBIDDEN, na->nick.c_str()); else { if (SendResetEmail(u, na)) { Log(LOG_COMMAND, u, this) << "for " << na->nick << " (group: " << na->nc->display << ")"; - u->SendMessage(NickServ, NICK_RESETPASS_COMPLETE, na->nick.c_str()); + source.Reply(NICK_RESETPASS_COMPLETE, na->nick.c_str()); } } @@ -82,7 +83,7 @@ class NSResetPass : public Module EventReturn OnPreCommand(User *u, BotInfo *service, const Anope::string &command, const std::vector<Anope::string> ¶ms) { - if (service == findbot(Config->s_NickServ) && command.equals_ci("CONFIRM") && !params.empty()) + if (service == NickServ && command.equals_ci("CONFIRM") && !params.empty()) { NickAlias *na = findnick(u->nick); @@ -94,7 +95,7 @@ class NSResetPass : public Module { na->nc->Shrink("ns_resetpass_code"); na->nc->Shrink("ns_resetpass_time"); - u->SendMessage(NickServ, NICK_CONFIRM_EXPIRED); + u->SendMessage(service, NICK_CONFIRM_EXPIRED); return EVENT_STOP; } @@ -114,7 +115,7 @@ class NSResetPass : public Module FOREACH_MOD(I_OnNickIdentify, OnNickIdentify(u)); Log(LOG_COMMAND, u, &commandnsresetpass) << "confirmed RESETPASS to forcefully identify to " << na->nick; - u->SendMessage(NickServ, NICK_CONFIRM_SUCCESS, Config->s_NickServ.c_str()); + u->SendMessage(service, NICK_CONFIRM_SUCCESS, Config->s_NickServ.c_str()); if (ircd->vhost) do_on_id(u); @@ -125,7 +126,7 @@ class NSResetPass : public Module else { Log(LOG_COMMAND, u, &commandnsresetpass) << "invalid confirm passcode for " << na->nick; - u->SendMessage(NickServ, NICK_CONFIRM_INVALID); + u->SendMessage(service, NICK_CONFIRM_INVALID); bad_password(u); } |