summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-03-22 16:46:15 +0100
committerAttila Molnar <attilamolnar@hush.com>2016-03-22 16:46:15 +0100
commitf71fe202e54f90190f3b5562de7926eb8265f3e5 (patch)
tree475525ff5a0388ea209e6a25383ead8d0cf52d8e
parent0de5aa7c5cfff6d2389f1adcc41d6b2deeec2bc4 (diff)
m_namedmodes Switch to Numeric::ParamBuilder
-rw-r--r--src/modules/m_namedmodes.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp
index 9c7b24666..d4263d899 100644
--- a/src/modules/m_namedmodes.cpp
+++ b/src/modules/m_namedmodes.cpp
@@ -21,24 +21,25 @@
static void DisplayList(LocalUser* user, Channel* channel)
{
- std::stringstream items;
+ Numeric::ParamBuilder<1> numeric(user, 961);
+ numeric.AddStatic(channel->name);
+
const ModeParser::ModeHandlerMap& mhs = ServerInstance->Modes->GetModes(MODETYPE_CHANNEL);
for (ModeParser::ModeHandlerMap::const_iterator i = mhs.begin(); i != mhs.end(); ++i)
{
ModeHandler* mh = i->second;
if (!channel->IsModeSet(mh))
continue;
- items << " +" << mh->name;
+ numeric.Add("+" + mh->name);
if (mh->GetNumParams(true))
{
if ((mh->name == "key") && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex")))
- items << " <key>";
+ numeric.Add("<key>");
else
- items << " " << channel->GetModeParameter(mh);
+ numeric.Add(channel->GetModeParameter(mh));
}
}
- const std::string line = ":" + ServerInstance->Config->ServerName + " 961 " + user->nick + " " + channel->name;
- user->SendText(line, items);
+ numeric.Flush();
user->WriteNumeric(960, channel->name, "End of mode list");
}