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/ns_status.cpp | |
parent | 37e02a3594fdddc3d5a3df0501c528f42db6c4da (diff) |
Send replies from fantasy commands back to the channel, this will be expanded on later
Diffstat (limited to 'modules/core/ns_status.cpp')
-rw-r--r-- | modules/core/ns_status.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/core/ns_status.cpp b/modules/core/ns_status.cpp index dd18d58e6..c33ace94d 100644 --- a/modules/core/ns_status.cpp +++ b/modules/core/ns_status.cpp @@ -21,29 +21,30 @@ class CommandNSStatus : 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) { - User *u2; - Anope::string nick = !params.empty() ? params[0] : u->nick; + User *u = source.u; + const Anope::string &nick = !params.empty() ? params[0] : u->nick; NickAlias *na = findnick(nick); spacesepstream sep(nick); Anope::string nickbuf; while (sep.GetToken(nickbuf)) { - if (!(u2 = finduser(nickbuf))) /* Nick is not online */ - u->SendMessage(NickServ, NICK_STATUS_REPLY, nickbuf.c_str(), 0, ""); + User *u2 = finduser(nickbuf); + if (!u2) /* Nick is not online */ + source.Reply(NICK_STATUS_REPLY, nickbuf.c_str(), 0, ""); else if (u2->IsIdentified() && na && na->nc == u2->Account()) /* Nick is identified */ - u->SendMessage(NickServ, NICK_STATUS_REPLY, nickbuf.c_str(), 3, u2->Account()->display.c_str()); + source.Reply(NICK_STATUS_REPLY, nickbuf.c_str(), 3, u2->Account()->display.c_str()); else if (u2->IsRecognized()) /* Nick is recognised, but NOT identified */ - u->SendMessage(NickServ, NICK_STATUS_REPLY, nickbuf.c_str(), 2, u2->Account() ? u2->Account()->display.c_str() : ""); + source.Reply(NICK_STATUS_REPLY, nickbuf.c_str(), 2, u2->Account() ? u2->Account()->display.c_str() : ""); else if (!na) /* Nick is online, but NOT a registered */ - u->SendMessage(NickServ, NICK_STATUS_REPLY, nickbuf.c_str(), 0, ""); + source.Reply(NICK_STATUS_REPLY, nickbuf.c_str(), 0, ""); else /* Nick is not identified for the nick, but they could be logged into an account, * so we tell the user about it */ - u->SendMessage(NickServ, NICK_STATUS_REPLY, nickbuf.c_str(), 1, u2->Account() ? u2->Account()->display.c_str() : ""); + source.Reply(NICK_STATUS_REPLY, nickbuf.c_str(), 1, u2->Account() ? u2->Account()->display.c_str() : ""); } return MOD_CONT; } |