aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_chanlog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_chanlog.cpp')
-rw-r--r--src/modules/m_chanlog.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp
index c80b4691c..68e6673a8 100644
--- a/src/modules/m_chanlog.cpp
+++ b/src/modules/m_chanlog.cpp
@@ -38,20 +38,20 @@ class ModuleChanLog : public Module
public:
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
- std::string snomasks;
- std::string channel;
ChanLogTargets newlogs;
ConfigTagList tags = ServerInstance->Config->ConfTags("chanlog");
for (ConfigIter i = tags.first; i != tags.second; ++i)
{
- channel = i->second->getString("channel");
- snomasks = i->second->getString("snomasks");
+ ConfigTag* tag = i->second;
- if (channel.empty() || snomasks.empty())
- {
- throw ModuleException("Malformed chanlog tag at " + i->second->getTagLocation());
- }
+ const std::string channel = tag->getString("channel");
+ if (!ServerInstance->IsChannel(channel))
+ throw ModuleException("<chanlog:channel> must be set to a channel name, at " + tag->getTagLocation());
+
+ const std::string snomasks = tag->getString("snomasks");
+ if (snomasks.empty())
+ throw ModuleException("<chanlog:snomasks> must not be empty, at " + tag->getTagLocation());
for (std::string::const_iterator it = snomasks.begin(); it != snomasks.end(); it++)
{
@@ -59,8 +59,8 @@ class ModuleChanLog : public Module
ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Logging %c to %s", *it, channel.c_str());
}
}
- logstreams.swap(newlogs);
+ logstreams.swap(newlogs);
}
ModResult OnSendSnotice(char &sno, std::string &desc, const std::string &msg) CXX11_OVERRIDE