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/hs_setall.cpp | |
parent | 37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff) |
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'modules/core/hs_setall.cpp')
-rw-r--r-- | modules/core/hs_setall.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/modules/core/hs_setall.cpp b/modules/core/hs_setall.cpp index 304a000b8..4a2f27ab6 100644 --- a/modules/core/hs_setall.cpp +++ b/modules/core/hs_setall.cpp @@ -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; } |