- for(char letter = 'A'; letter <= 'z'; letter++)
- {
- ModeHandler* mh = ServerInstance->Modes->FindMode(letter, MODETYPE_CHANNEL);
- if (!mh || mh->IsListMode())
- continue;
- if (!channel->IsModeSet(letter))
- continue;
- 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());
- }
- user->WriteNumeric(960, "%s %s :End of mode list", user->nick.c_str(), channel->name.c_str());
+ list = true;
+ }
+};
+
+class ModuleNamedModes : public Module
+{
+ CommandProp cmd;
+ DummyZ dummyZ;
+ public:
+ ModuleNamedModes() : cmd(this), dummyZ(this)
+ {
+ }
+
+ void init()
+ {
+ ServerInstance->Modules->AddService(cmd);
+ ServerInstance->Modules->AddService(dummyZ);
+
+ Implementation eventlist[] = { I_OnPreMode };
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
+ }
+
+ Version GetVersion()
+ {
+ return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR);
+ }
+
+ void Prioritize()
+ {
+ ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_FIRST);