void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
+ // Process the escape codes in the MOTDs.
+ ConfigFileCache newmotds;
+ for (ServerConfig::ClassVector::const_iterator iter = ServerInstance->Config->Classes.begin(); iter != ServerInstance->Config->Classes.end(); ++iter)
+ {
+ ConfigTag* tag = (*iter)->config;
+ // Don't process the file if it has already been processed.
+ const std::string motd = tag->getString("motd", "motd");
+ if (newmotds.find(motd) != newmotds.end())
+ continue;
+
+ // We can't process the file if it doesn't exist.
+ ConfigFileCache::iterator file = ServerInstance->Config->Files.find(motd);
+ if (file == ServerInstance->Config->Files.end())
+ continue;
+
+ // Process escape codes.
+ newmotds[file->first] = file->second;
+ InspIRCd::ProcessColors(newmotds[file->first]);
+ }
+
+ cmdmotd.motds.swap(newmotds);
+
ConfigTag* tag = ServerInstance->Config->ConfValue("admin");
cmdadmin.AdminName = tag->getString("name");
cmdadmin.AdminEmail = tag->getString("email", "null@example.com");
if (ServerInstance->Config->RawLog)
{
- ClientProtocol::Messages::Privmsg rawlogmsg(ServerInstance->FakeClient, user, "*** Raw I/O logging is enabled on user server. All messages, passwords, and commands are being recorded.");
+ ClientProtocol::Messages::Privmsg rawlogmsg(ServerInstance->FakeClient, user, "*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded.");
user->Send(ServerInstance->GetRFCEvents().privmsg, rawlogmsg);
}
}