]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_namedmodes.cpp
Convert InspIRCd::PassCompare to return bool instead of int.
[user/henk/code/inspircd.git] / src / modules / m_namedmodes.cpp
index 3e27092a7fbb1ec1e329fe5eb9117cd3859b9baf..d3f9f94a47871a36ef4455151d664c62b83cf2a6 100644 (file)
@@ -17,8 +17,6 @@
  */
 
 
-/* $ModDesc: Provides the ability to manipulate modes via long names. */
-
 #include "inspircd.h"
 
 static void DisplayList(User* user, Channel* channel)
@@ -29,15 +27,15 @@ static void DisplayList(User* user, Channel* channel)
                ModeHandler* mh = ServerInstance->Modes->FindMode(letter, MODETYPE_CHANNEL);
                if (!mh || mh->IsListMode())
                        continue;
-               if (!channel->IsModeSet(letter))
+               if (!channel->IsModeSet(mh))
                        continue;
                items << " +" << mh->name;
                if (mh->GetNumParams(true))
-                       items << " " << channel->GetModeParameter(letter);
+                       items << " " << channel->GetModeParameter(mh);
        }
        const std::string line = ":" + ServerInstance->Config->ServerName + " 961 " + user->nick + " " + channel->name;
        user->SendText(line, items);
-       user->WriteNumeric(960, "%s %s :End of mode list", user->nick.c_str(), channel->name.c_str());
+       user->WriteNumeric(960, "%s :End of mode list", channel->name.c_str());
 }
 
 class CommandProp : public Command
@@ -82,7 +80,7 @@ class CommandProp : public Command
                                }
                        }
                }
-               ServerInstance->SendGlobalMode(modes, src);
+               ServerInstance->Modes->Process(modes, src);
                return CMD_SUCCESS;
        }
 };
@@ -105,15 +103,6 @@ class ModuleNamedModes : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-               ServerInstance->Modules->AddService(dummyZ);
-
-               Implementation eventlist[] = { I_OnPreMode };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR);
@@ -196,7 +185,7 @@ class ModuleNamedModes : public Module
                        }
                }
                newparms[1] = modelist;
-               ServerInstance->Modes->Process(newparms, source, false);
+               ServerInstance->Modes->Process(newparms, source);
                return MOD_RES_DENY;
        }
 };