aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_chanlog.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-03-11 14:27:32 +0000
committerGravatar Sadie Powell2022-03-11 14:52:56 +0000
commit2d329701db1d5c0361c018e088eb82c457f8ec7c (patch)
tree7897c5fcdf7eecb8c96bf31c030043d76574fa23 /src/modules/m_chanlog.cpp
parentRefactor the opermodes module. (diff)
parentUse UCHAR_MAX instead of raw sizes in channames. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_chanlog.cpp')
-rw-r--r--src/modules/m_chanlog.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp
index 1171a10c2..d776c216a 100644
--- a/src/modules/m_chanlog.cpp
+++ b/src/modules/m_chanlog.cpp
@@ -47,12 +47,13 @@ public:
ChanLogTargets newlogs;
for (const auto& [_, tag] : ServerInstance->Config->ConfTags("chanlog"))
{
- std::string channel = tag->getString("channel");
- std::string snomasks = tag->getString("snomasks");
- if (channel.empty() || snomasks.empty())
- {
- throw ModuleException(this, "Malformed chanlog tag at " + tag->source.str());
- }
+ const std::string channel = tag->getString("channel");
+ if (!ServerInstance->Channels.IsChannel(channel))
+ throw ModuleException(this, "<chanlog:channel> must be set to a channel name, at " + tag->source.str());
+
+ const std::string snomasks = tag->getString("snomasks");
+ if (snomasks.empty())
+ throw ModuleException(this, "<chanlog:snomasks> must not be empty, at " + tag->source.str());
for (const auto& snomask : snomasks)
{
@@ -61,7 +62,6 @@ public:
}
}
logstreams.swap(newlogs);
-
}
ModResult OnSendSnotice(char &sno, std::string &desc, const std::string &msg) override