mirror of
https://github.com/anope/anope.git
synced 2026-07-01 14:06:39 +02:00
Send replies from fantasy commands back to the channel, this will be expanded on later
This commit is contained in:
+17
-15
@@ -20,23 +20,24 @@ class CommandHSSetAll : public Command
|
||||
{
|
||||
}
|
||||
|
||||
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];
|
||||
Anope::string rawhostmask = params[1];
|
||||
Anope::string hostmask;
|
||||
|
||||
NickAlias *na;
|
||||
int32 tmp_time;
|
||||
|
||||
if (!(na = findnick(nick)))
|
||||
NickAlias *na = findnick(nick);
|
||||
if (!na)
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_NOREG, nick.c_str());
|
||||
source.Reply(HOST_NOREG, nick.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
else if (na->HasFlag(NS_FORBIDDEN))
|
||||
{
|
||||
u->SendMessage(HostServ, NICK_X_FORBIDDEN, nick.c_str());
|
||||
source.Reply(NICK_X_FORBIDDEN, nick.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -46,12 +47,12 @@ class CommandHSSetAll : public Command
|
||||
rawhostmask = myStrGetTokenRemainder(rawhostmask, '@', 1); /* get the remaining string */
|
||||
if (rawhostmask.empty())
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_SETALL_SYNTAX, Config->s_HostServ.c_str());
|
||||
source.Reply(HOST_SETALL_SYNTAX, Config->s_HostServ.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
if (vIdent.length() > Config->UserLen)
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_SET_IDENTTOOLONG, Config->UserLen);
|
||||
source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen);
|
||||
return MOD_CONT;
|
||||
}
|
||||
else
|
||||
@@ -59,28 +60,29 @@ class CommandHSSetAll : public Command
|
||||
for (Anope::string::iterator s = vIdent.begin(), s_end = vIdent.end(); s != s_end; ++s)
|
||||
if (!isvalidchar(*s))
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_SET_IDENT_ERROR);
|
||||
source.Reply(HOST_SET_IDENT_ERROR);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
if (!ircd->vident)
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_NO_VIDENT);
|
||||
source.Reply(HOST_NO_VIDENT);
|
||||
return MOD_CONT;
|
||||
}
|
||||
}
|
||||
|
||||
Anope::string hostmask;
|
||||
if (rawhostmask.length() < Config->HostLen)
|
||||
hostmask = rawhostmask;
|
||||
else
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_SET_TOOLONG, Config->HostLen);
|
||||
source.Reply(HOST_SET_TOOLONG, Config->HostLen);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!isValidHost(hostmask, 3))
|
||||
{
|
||||
u->SendMessage(HostServ, HOST_SET_ERROR);
|
||||
source.Reply(HOST_SET_ERROR);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -92,9 +94,9 @@ class CommandHSSetAll : public Command
|
||||
HostServSyncVhosts(na);
|
||||
FOREACH_MOD(I_OnSetVhost, OnSetVhost(na));
|
||||
if (!vIdent.empty())
|
||||
u->SendMessage(HostServ, HOST_IDENT_SETALL, nick.c_str(), vIdent.c_str(), hostmask.c_str());
|
||||
source.Reply(HOST_IDENT_SETALL, nick.c_str(), vIdent.c_str(), hostmask.c_str());
|
||||
else
|
||||
u->SendMessage(HostServ, HOST_SETALL, nick.c_str(), hostmask.c_str());
|
||||
source.Reply(HOST_SETALL, nick.c_str(), hostmask.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user