1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 10:26:37 +02:00

Send replies from fantasy commands back to the channel, this will be expanded on later

This commit is contained in:
Adam
2010-11-24 21:40:56 -06:00
parent 37e02a3594
commit cb6ef574e3
154 changed files with 2428 additions and 2111 deletions
+8 -7
View File
@@ -23,17 +23,18 @@ class CommandNSSendPass : 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];
NickAlias *na;
if (Config->RestrictMail && (!u->Account() || !u->Account()->HasCommand("nickserv/sendpass")))
u->SendMessage(NickServ, ACCESS_DENIED);
source.Reply(ACCESS_DENIED);
else 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
{
Anope::string tmp_pass;
@@ -42,11 +43,11 @@ class CommandNSSendPass : public Command
if (SendPassMail(u, na, tmp_pass))
{
Log(Config->RestrictMail ? LOG_ADMIN : LOG_COMMAND, u, this) << "for " << na->nick;
u->SendMessage(NickServ, NICK_SENDPASS_OK, nick.c_str());
source.Reply(NICK_SENDPASS_OK, nick.c_str());
}
}
else
u->SendMessage(NickServ, NICK_SENDPASS_UNAVAILABLE);
source.Reply(NICK_SENDPASS_UNAVAILABLE);
}
return MOD_CONT;