]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_namedmodes.cpp
Fix iteration of oper blocks by SSLINFO
[user/henk/code/inspircd.git] / src / modules / m_namedmodes.cpp
index 4bf8960e15058321147394a4375a2520f2ccd880..00bb859d4d3ae1c589f20a67426708987f04871e 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -27,6 +27,11 @@ class ModuleNamedModes : public Module
                return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR);
        }
 
+       void Prioritize()
+       {
+               ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_FIRST);
+       }
+
        void On005Numeric(std::string& line)
        {
                std::string::size_type pos = line.find(" CHANMODES=");
@@ -41,6 +46,7 @@ class ModuleNamedModes : public Module
 
        void DisplayList(User* user, Channel* channel)
        {
+               std::stringstream items;
                for(char letter = 'A'; letter <= 'z'; letter++)
                {
                        ModeHandler* mh = ServerInstance->Modes->FindMode(letter, MODETYPE_CHANNEL);
@@ -51,8 +57,11 @@ class ModuleNamedModes : public Module
                        std::string item = mh->name;
                        if (mh->GetNumParams(true))
                                item += "=" + channel->GetModeParameter(letter);
-                       user->WriteNumeric(961, "%s %s %s", user->nick.c_str(), channel->name.c_str(), item.c_str());
+                       items << item << " ";
                }
+               char pfx[MAXBUF];
+               snprintf(pfx, MAXBUF, ":%s 961 %s %s", ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), channel->name.c_str());
+               user->SendText(std::string(pfx), items);
                user->WriteNumeric(960, "%s %s :End of mode list", user->nick.c_str(), channel->name.c_str());
        }