diff options
author | Adam <Adam@anope.org> | 2013-11-12 06:51:31 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-11-12 06:51:31 -0500 |
commit | 6c7a3ceb6c674a9af09da955ee0238e9291cf29a (patch) | |
tree | c9fd79d5814685e43f5d9ade75cad5f11da06364 /src/modules/m_helpop.cpp | |
parent | 407f8ef1391e5d09e99e0abfc570389decc3ce2d (diff) |
Use WriteNumeric() everywhere we send numerics and include the user's nick automatically
Diffstat (limited to 'src/modules/m_helpop.cpp')
-rw-r--r-- | src/modules/m_helpop.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index f316d42d1..d07898c90 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -55,17 +55,15 @@ class CommandHelpop : public Command if (parameter == "index") { /* iterate over all helpop items */ - user->WriteServ("290 %s :HELPOP topic index", user->nick.c_str()); + user->WriteNumeric(290, ":HELPOP topic index"); for (std::map<irc::string, std::string>::iterator iter = helpop_map.begin(); iter != helpop_map.end(); iter++) - { - user->WriteServ("292 %s : %s", user->nick.c_str(), iter->first.c_str()); - } - user->WriteServ("292 %s :*** End of HELPOP topic index", user->nick.c_str()); + user->WriteNumeric(292, ": %s", iter->first.c_str()); + user->WriteNumeric(292, ":*** End of HELPOP topic index"); } else { - user->WriteServ("290 %s :*** HELPOP for %s", user->nick.c_str(), parameter.c_str()); - user->WriteServ("292 %s : -", user->nick.c_str()); + user->WriteNumeric(290, ":*** HELPOP for %s", parameter.c_str()); + user->WriteNumeric(292, ": -"); std::map<irc::string, std::string>::iterator iter = helpop_map.find(parameter); @@ -82,13 +80,13 @@ class CommandHelpop : public Command { // Writing a blank line will not work with some clients if (token.empty()) - user->WriteServ("292 %s : ", user->nick.c_str()); + user->WriteNumeric(292, ": "); else - user->WriteServ("292 %s :%s", user->nick.c_str(), token.c_str()); + user->WriteNumeric(292, ":%s", token.c_str()); } - user->WriteServ("292 %s : -", user->nick.c_str()); - user->WriteServ("292 %s :*** End of HELPOP", user->nick.c_str()); + user->WriteNumeric(292, ": -"); + user->WriteNumeric(292, ":*** End of HELPOP"); } return CMD_SUCCESS; } @@ -143,7 +141,7 @@ class ModuleHelpop : public Module { if (dst->IsModeSet(ho)) { - ServerInstance->SendWhoisLine(src, dst, 310, src->nick+" "+dst->nick+" :is available for help."); + ServerInstance->SendWhoisLine(src, dst, 310, dst->nick+" :is available for help."); } } |