X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_autoop.cpp;h=85b14ba7ad6dfdfb1dac8782f292635b316911ae;hb=4b41feea830fc84e8c1b2fd0982f3e8d8840af96;hp=40a57d7c3cf7024c2ffd53ba4d508f573716601f;hpb=1debdd986a562c2dc4053c7ade8b6c5fdf567e73;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp index 40a57d7c3..85b14ba7a 100644 --- a/src/modules/m_autoop.cpp +++ b/src/modules/m_autoop.cpp @@ -19,7 +19,7 @@ #include "inspircd.h" -#include "u_listmode.h" +#include "listmode.h" /* $ModDesc: Provides support for the +w channel mode, autoop list */ @@ -82,28 +82,32 @@ class ModuleAutoOp : public Module { AutoOpList mh; -public: + public: ModuleAutoOp() : mh(this) + { + } + + void init() CXX11_OVERRIDE { ServerInstance->Modules->AddService(mh); mh.DoImplements(this); Implementation list[] = { I_OnPostJoin, }; - ServerInstance->Modules->Attach(list, this, 1); + 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 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,22 +127,17 @@ public: } } - void OnCleanup(int target_type, void* item) - { - mh.DoCleanup(target_type, item); - } - - 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); }