+ ConfigReader MyConf;
+ std::string snomasks;
+ std::string channel;
+
+ logstreams.clear();
+
+ for (int i = 0; i < MyConf.Enumerate("chanlog"); i++)
+ {
+ channel = MyConf.ReadValue("chanlog", "channel", i);
+ snomasks = MyConf.ReadValue("chanlog", "snomasks", i);
+
+ if (channel.empty() || snomasks.empty())
+ {
+ ServerInstance->Logs->Log("m_chanlog", 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", DEFAULT, "Logging %c to %s", *it, channel.c_str());
+ }
+ }
+
+ }
+
+ virtual ModResult OnSendSnotice(char &sno, std::string &desc, const std::string &msg)
+ {
+ std::multimap<char, std::string>::const_iterator it = logstreams.find(sno);
+ char buf[MAXBUF];
+
+ if (it == logstreams.end())
+ return MOD_RES_PASSTHRU;
+
+ snprintf(buf, MAXBUF, "\2%s\2: %s", desc.c_str(), msg.c_str());
+
+ while (it != logstreams.end())