+ 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");
+
+ if (channel.empty() || snomasks.empty())
+ {
+ ServerInstance->Logs->Log("m_chanlog", LOG_DEFAULT, "Malformed chanlog tag, ignoring");
+ continue;
+ }
+
+ for (std::string::const_iterator it = snomasks.begin(); it != snomasks.end(); it++)
+ {
+ logstreams.insert(std::make_pair(*it, channel));
+ ServerInstance->Logs->Log("m_chanlog", LOG_DEFAULT, "Logging %c to %s", *it, channel.c_str());
+ }
+ }
+
+ }
+
+ virtual ModResult OnSendSnotice(char &sno, std::string &desc, const std::string &msg)
+ {
+ std::pair<ChanLogTargets::const_iterator, ChanLogTargets::const_iterator> itpair = logstreams.equal_range(sno);
+ if (itpair.first == itpair.second)
+ return MOD_RES_PASSTHRU;
+
+ char buf[MAXBUF];
+ snprintf(buf, MAXBUF, "\2%s\2: %s", desc.c_str(), msg.c_str());
+
+ for (ChanLogTargets::const_iterator it = itpair.first; it != itpair.second; ++it)