summaryrefslogtreecommitdiff
path: root/modules/core/ns_release.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-11-24 21:40:56 -0600
committerAdam <Adam@anope.org>2010-12-12 19:36:19 -0500
commitcb6ef574e3df5cc846247450b74ca37d265f319e (patch)
tree8ce3374a537c312af63c78125bfea4622bb188f0 /modules/core/ns_release.cpp
parent37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff)
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'modules/core/ns_release.cpp')
-rw-r--r--modules/core/ns_release.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/modules/core/ns_release.cpp b/modules/core/ns_release.cpp
index b8b517e36..743b7a2ec 100644
--- a/modules/core/ns_release.cpp
+++ b/modules/core/ns_release.cpp
@@ -21,31 +21,32 @@ class CommandNSRelease : public Command
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
}
- CommandReturn Execute(User *u, const std::vector<Anope::string> &params)
+ CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
{
- Anope::string nick = params[0];
+ User *u = source.u;
+ const Anope::string &nick = params[0];
Anope::string pass = params.size() > 1 ? params[1] : "";
NickAlias *na;
if (!(na = findnick(nick)))
- u->SendMessage(NickServ, NICK_X_NOT_REGISTERED, nick.c_str());
+ source.Reply(NICK_X_NOT_REGISTERED, nick.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 (na->nc->HasFlag(NI_SUSPENDED))
- u->SendMessage(NickServ, NICK_X_SUSPENDED, na->nick.c_str());
+ source.Reply(NICK_X_SUSPENDED, na->nick.c_str());
else if (!na->HasFlag(NS_HELD))
- u->SendMessage(NickServ, NICK_RELEASE_NOT_HELD, nick.c_str());
+ source.Reply(NICK_RELEASE_NOT_HELD, nick.c_str());
else if (!pass.empty())
{
int res = enc_check_password(pass, na->nc->pass);
if (res == 1)
{
Log(LOG_COMMAND, u, this) << "released " << na->nick;
- u->SendMessage(NickServ, NICK_RELEASED);
+ source.Reply(NICK_RELEASED);
}
else
{
- u->SendMessage(NickServ, ACCESS_DENIED);
+ source.Reply(ACCESS_DENIED);
if (!res)
{
Log(LOG_COMMAND, u, this) << "invalid password for " << nick;
@@ -59,10 +60,10 @@ class CommandNSRelease : public Command
if (u->Account() == na->nc || (!na->nc->HasFlag(NI_SECURE) && is_on_access(u, na->nc)))
{
na->Release();
- u->SendMessage(NickServ, NICK_RELEASED);
+ source.Reply(NICK_RELEASED);
}
else
- u->SendMessage(NickServ, ACCESS_DENIED);
+ source.Reply(ACCESS_DENIED);
}
return MOD_CONT;
}