diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-02-25 16:12:09 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-02-25 16:12:09 +0100 |
commit | da29af8cba49d51e53d6e68237ccbf6370b6dd1f (patch) | |
tree | 5546764f28ff9457efa3a0f90ae6778953590293 /src/modules/m_spanningtree | |
parent | 28dcc1f9e017152f03b0d9bfbcc494260b015a0a (diff) |
Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_map.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_whois.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/uid.cpp | 2 |
4 files changed, 10 insertions, 11 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 726376844..ade8359ba 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -127,16 +127,15 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) else if ((Current->Hidden) && (!user->IsOper())) return; - user->WriteNumeric(RPL_LINKS, "%s %s :%d %s", Current->GetName().c_str(), - (Utils->FlatLinks && (!user->IsOper())) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(), - (Utils->FlatLinks && (!user->IsOper())) ? 0 : hops, - Current->GetDesc().c_str()); + user->WriteNumeric(RPL_LINKS, Current->GetName(), + (((Utils->FlatLinks) && (!user->IsOper())) ? ServerInstance->Config->ServerName : Parent), + InspIRCd::Format("%d %s", (((Utils->FlatLinks) && (!user->IsOper())) ? 0 : hops), Current->GetDesc().c_str())); } void ModuleSpanningTree::HandleLinks(const std::vector<std::string>& parameters, User* user) { ShowLinks(Utils->TreeRoot,user,0); - user->WriteNumeric(RPL_ENDOFLINKS, "* :End of /LINKS list."); + user->WriteNumeric(RPL_ENDOFLINKS, '*', "End of /LINKS list."); } std::string ModuleSpanningTree::TimeToStr(time_t secs) @@ -304,11 +303,11 @@ ModResult ModuleSpanningTree::HandleVersion(const std::vector<std::string>& para // or the server is a 2.0 server and does not send a full version. bool showfull = ((user->IsOper()) && (!found->GetFullVersion().empty())); const std::string& Version = (showfull ? found->GetFullVersion() : found->GetVersion()); - user->WriteNumeric(RPL_VERSION, ":%s", Version.c_str()); + user->WriteNumeric(RPL_VERSION, Version); } else { - user->WriteNumeric(ERR_NOSUCHSERVER, "%s :No such server", parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHSERVER, parameters[0], "No such server"); } return MOD_RES_DENY; } diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index 612df80f3..7ae6c6b4a 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -172,7 +172,7 @@ CmdResult CommandMap::Handle(const std::vector<std::string>& parameters, User* u TreeServer* s = Utils->FindServerMask(parameters[0]); if (!s) { - user->WriteNumeric(ERR_NOSUCHSERVER, "%s :No such server", parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHSERVER, parameters[0], "No such server"); return CMD_FAILURE; } diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 430467dc7..7f7189854 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -31,8 +31,8 @@ ModResult ModuleSpanningTree::HandleRemoteWhois(const std::vector<std::string>& } else if (!remote) { - user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[1].c_str()); - user->WriteNumeric(RPL_ENDOFWHOIS, "%s :End of /WHOIS list.", parameters[1].c_str()); + user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + user->WriteNumeric(RPL_ENDOFWHOIS, parameters[0], "End of /WHOIS list."); return MOD_RES_DENY; } return MOD_RES_PASSTHRU; diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index a3b804579..01465670a 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -50,7 +50,7 @@ CmdResult CommandUID::HandleServer(TreeServer* remoteserver, std::vector<std::st // User that the incoming user is colliding with is not fully registered, we force nick change the // unregistered user to their uuid and tell them what happened collideswith->WriteFrom(collideswith, "NICK %s", collideswith->uuid.c_str()); - collideswith->WriteNumeric(ERR_NICKNAMEINUSE, "%s :Nickname overruled.", collideswith->nick.c_str()); + collideswith->WriteNumeric(ERR_NICKNAMEINUSE, collideswith->nick, "Nickname overruled."); // Clear the bit before calling User::ChangeNick() to make it NOT run the OnUserPostNick() hook collideswith->registered &= ~REG_NICK; |