X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_helpop.cpp;h=4bbe8785e4ef4f7b2f22d059b56f81682eb8d6fe;hb=91c34d4e971dcc9370d205ff6d8189cd92f1d556;hp=60c23f45bd44820c39b5e01496a804551c535a1c;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 60c23f45b..4bbe8785e 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -99,7 +99,6 @@ class CommandHelpop : public Command class ModuleHelpop : public Module { private: - std::string h_file; CommandHelpop cmd; Helpop ho; @@ -115,12 +114,12 @@ class ModuleHelpop : public Module ServerInstance->Modules->AddService(ho); ServerInstance->Modules->AddService(cmd); Implementation eventlist[] = { I_OnRehash, I_OnWhois }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } void ReadConfig() { - helpop_map.clear(); + std::map help; ConfigTagList tags = ServerInstance->Config->ConfTags("helpop"); for(ConfigIter i = tags.first; i != tags.second; ++i) @@ -135,20 +134,21 @@ class ModuleHelpop : public Module throw ModuleException("m_helpop: The key 'index' is reserved for internal purposes. Please remove it."); } - helpop_map[key] = value; + help[key] = value; } - if (helpop_map.find("start") == helpop_map.end()) + if (help.find("start") == help.end()) { // error! throw ModuleException("m_helpop: Helpop file is missing important entry 'start'. Please check the example conf."); } - else if (helpop_map.find("nohelp") == helpop_map.end()) + else if (help.find("nohelp") == help.end()) { // error! throw ModuleException("m_helpop: Helpop file is missing important entry 'nohelp'. Please check the example conf."); } + helpop_map.swap(help); } void OnRehash(User* user) @@ -160,7 +160,7 @@ class ModuleHelpop : public Module { if (dst->IsModeSet('h')) { - ServerInstance->SendWhoisLine(src, dst, 310, std::string(src->nick)+" "+std::string(dst->nick)+" :is available for help."); + ServerInstance->SendWhoisLine(src, dst, 310, src->nick+" "+dst->nick+" :is available for help."); } }