]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_namedmodes.cpp
Add SSLIOHook::IsSSL() to determine whether a socket is using SSL or not
[user/henk/code/inspircd.git] / src / modules / m_namedmodes.cpp
index 9c7b24666eeba64a270be87855d885357cb3ac84..d4263d899d46a741ee20482736043b904f18577c 100644 (file)
 
 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");
 }