X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_shun.cpp;h=5388bb4856da5a2b078d3a9a8cce9c72a742956e;hb=f9fd78c01623514a060c607534fc52cb73140200;hp=dbc1812c700ce96e42f244097e1d13fa4d6bf40e;hpb=1031f333332cf1b09db4fd632f141143ee637c34;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index dbc1812c7..5388bb485 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -140,7 +140,7 @@ class CommandShun : public Command else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteToSnoMask('x', "%s added timed SHUN for %s to expire on %s: %s", user->nick.c_str(), target.c_str(), timestr.c_str(), expr.c_str()); } @@ -168,7 +168,7 @@ class ModuleShun : public Module { CommandShun cmd; ShunFactory f; - std::set ShunEnabledCommands; + insp::flat_set ShunEnabledCommands; bool NotifyOfShun; bool affectopers; @@ -180,9 +180,6 @@ class ModuleShun : public Module void init() CXX11_OVERRIDE { ServerInstance->XLines->RegisterFactory(&f); - ServerInstance->Modules->AddService(cmd); - - OnRehash(NULL); } ~ModuleShun() @@ -194,19 +191,19 @@ class ModuleShun : public Module void Prioritize() { Module* alias = ServerInstance->Modules->Find("m_alias.so"); - ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_BEFORE, &alias); + ServerInstance->Modules->SetPriority(this, I_OnPreCommand, PRIORITY_BEFORE, alias); } - ModResult OnStats(char symbol, User* user, string_list& out) CXX11_OVERRIDE + ModResult OnStats(Stats::Context& stats) CXX11_OVERRIDE { - if (symbol != 'H') + if (stats.GetSymbol() != 'H') return MOD_RES_PASSTHRU; - ServerInstance->XLines->InvokeStats("SHUN", 223, user, out); + ServerInstance->XLines->InvokeStats("SHUN", 223, stats); return MOD_RES_DENY; } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("shun"); std::string cmds = tag->getString("enabledcommands"); @@ -246,9 +243,7 @@ class ModuleShun : public Module return MOD_RES_PASSTHRU; } - std::set::iterator i = ShunEnabledCommands.find(command); - - if (i == ShunEnabledCommands.end()) + if (!ShunEnabledCommands.count(command)) { if (NotifyOfShun) user->WriteNotice("*** Command " + command + " not processed, as you have been blocked from issuing commands (SHUN)");