diff options
Diffstat (limited to 'src/modules/m_autoop.cpp')
-rw-r--r-- | src/modules/m_autoop.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp index 07dca6929..6bc5f464c 100644 --- a/src/modules/m_autoop.cpp +++ b/src/modules/m_autoop.cpp @@ -19,9 +19,7 @@ #include "inspircd.h" -#include "u_listmode.h" - -/* $ModDesc: Provides support for the +w channel mode, autoop list */ +#include "listmode.h" /** Handles +w channel mode */ @@ -82,32 +80,29 @@ class ModuleAutoOp : public Module { AutoOpList mh; -public: + public: ModuleAutoOp() : mh(this) { } - void init() + void init() CXX11_OVERRIDE { ServerInstance->Modules->AddService(mh); mh.DoImplements(this); - - Implementation list[] = { I_OnPostJoin, }; - ServerInstance->Modules->Attach(list, this, sizeof(list)/sizeof(Implementation)); } - void OnPostJoin(Membership *memb) + void OnPostJoin(Membership *memb) CXX11_OVERRIDE { if (!IS_LOCAL(memb->user)) return; - modelist* list = mh.extItem.get(memb->chan); + ListModeBase::ModeList* list = mh.GetList(memb->chan); if (list) { std::string modeline("+"); std::vector<std::string> modechange; modechange.push_back(memb->chan->name); - for (modelist::iterator it = list->begin(); it != list->end(); it++) + for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++) { std::string::size_type colon = it->mask.find(':'); if (colon == std::string::npos) @@ -123,21 +118,21 @@ public: for(std::string::size_type i = modeline.length(); i > 1; --i) // we use "i > 1" instead of "i" so we skip the + modechange.push_back(memb->user->nick); if(modechange.size() >= 3) - ServerInstance->SendGlobalMode(modechange, ServerInstance->FakeClient); + ServerInstance->Modes->Process(modechange, ServerInstance->FakeClient); } } - void OnSyncChannel(Channel* chan, Module* proto, void* opaque) + void OnSyncChannel(Channel* chan, Module* proto, void* opaque) CXX11_OVERRIDE { mh.DoSyncChannel(chan, proto, opaque); } - void OnRehash(User* user) + void OnRehash(User* user) CXX11_OVERRIDE { mh.DoRehash(); } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for the +w channel mode", VF_VENDOR); } |