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:
@@ -23,17 +23,18 @@ class CommandNSSendPass : 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)
|
||||
{
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user