X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_callerid.cpp;h=7f843f25253e15dee448d4f3ac412ef93defa380;hb=b71f1affeaa2dbc1d4e5fdf799ab1527a190b0e1;hp=f24c38b653acbfa074eee188a393497e84dd25e8;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index f24c38b65..7f843f252 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -119,6 +119,7 @@ struct CallerIDExtInfo : public ExtensionItem if (it2 != targ->wholistsme.end()) targ->wholistsme.erase(it2); } + delete dat; } }; @@ -136,6 +137,7 @@ public: CommandAccept(Module* Creator) : Command(Creator, "ACCEPT", 1), extInfo(Creator) { + allow_empty_last_param = false; syntax = "{[+|-]}|*}"; TRANSLATE2(TR_CUSTOM, TR_END); } @@ -144,7 +146,7 @@ public: { if (index != 0) return; - std::string out = ""; + std::string out; irc::commasepstream nicks(parameter); std::string tok; while (nicks.GetToken(tok)) @@ -338,7 +340,7 @@ public: ServerInstance->Modules->AddService(cmd.extInfo); Implementation eventlist[] = { I_OnRehash, I_OnUserPostNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage }; - ServerInstance->Modules->Attach(eventlist, this, 6); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } virtual ~ModuleCallerID() @@ -412,11 +414,11 @@ public: virtual void OnRehash(User* user) { - ConfigReader Conf; - cmd.maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true); - operoverride = Conf.ReadFlag("callerid", "operoverride", "0", 0); - tracknick = Conf.ReadFlag("callerid", "tracknick", "0", 0); - notify_cooldown = Conf.ReadInteger("callerid", "cooldown", "60", 0, true); + ConfigTag* tag = ServerInstance->Config->ConfValue("callerid"); + cmd.maxaccepts = tag->getInt("maxaccepts", 16); + operoverride = tag->getBool("operoverride"); + tracknick = tag->getBool("tracknick"); + notify_cooldown = tag->getInt("cooldown", 60); } };