X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_mlock.cpp;h=2a0410bedcacd3e6fc84da2048f379caa7508d1e;hb=6de3017e2cda445bfd9e6b460a35eae7fc199148;hp=43eadf63ee5d4222764c90ecdf3d5013e2928bda;hpb=992674362c5f64bdb8e1942eeaa7612524529cd6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_mlock.cpp b/src/modules/m_mlock.cpp index 43eadf63e..2a0410bed 100644 --- a/src/modules/m_mlock.cpp +++ b/src/modules/m_mlock.cpp @@ -23,20 +23,18 @@ class ModuleMLock : public Module { StringExtItem mlock; -public: - ModuleMLock() : mlock("mlock", this) {}; - - Version GetVersion() CXX11_OVERRIDE + public: + ModuleMLock() + : mlock("mlock", ExtensionItem::EXT_CHANNEL, this) { - return Version("Implements the ability to have server-side MLOCK enforcement.", VF_VENDOR); } - void Prioritize() + Version GetVersion() CXX11_OVERRIDE { - ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_FIRST); + return Version("Implements the ability to have server-side MLOCK enforcement.", VF_VENDOR); } - ModResult OnPreMode(User* source, User* dest, Channel* channel, const std::vector& parameters) CXX11_OVERRIDE + ModResult OnRawMode(User* source, Channel* channel, ModeHandler* mh, const std::string& parameter, bool adding) CXX11_OVERRIDE { if (!channel) return MOD_RES_PASSTHRU; @@ -48,11 +46,11 @@ public: if (!mlock_str) return MOD_RES_PASSTHRU; - std::string::size_type p = parameters[1].find_first_of(*mlock_str); + const char mode = mh->GetModeChar(); + std::string::size_type p = mlock_str->find(mode); if (p != std::string::npos) { - source->WriteNumeric(742, "%s %c %s :MODE cannot be set due to channel having an active MLOCK restriction policy", - channel->name.c_str(), parameters[1][p], mlock_str->c_str()); + source->WriteNumeric(742, channel->name, mode, *mlock_str, "MODE cannot be set due to channel having an active MLOCK restriction policy"); return MOD_RES_DENY; }