From 5fff3610d5fe938213e98a24ed67263f8bee7a55 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 29 Mar 2020 11:57:09 +0100 Subject: Clean up the parsing logic for . --- src/modules/m_shun.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 99ff05c30..f10ac79f5 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -194,20 +194,13 @@ class ModuleShun : public Module, public Stats::EventListener void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("shun"); - std::string cmds = tag->getString("enabledcommands"); - std::transform(cmds.begin(), cmds.end(), cmds.begin(), ::toupper); - - if (cmds.empty()) - cmds = "PING PONG QUIT"; ShunEnabledCommands.clear(); - - irc::spacesepstream dcmds(cmds); - std::string thiscmd; - - while (dcmds.GetToken(thiscmd)) + irc::spacesepstream enabledcmds(tag->getString("enabledcommands", "PING PONG QUIT", 1)); + for (std::string enabledcmd; enabledcmds.GetToken(enabledcmd); ) { - ShunEnabledCommands.insert(thiscmd); + std::transform(enabledcmd.begin(), enabledcmd.end(), enabledcmd.begin(), ::toupper); + ShunEnabledCommands.insert(enabledcmd); } NotifyOfShun = tag->getBool("notifyuser", true); -- cgit v1.2.3