summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/cmd_motd.cpp7
-rw-r--r--src/commands/cmd_rules.cpp5
2 files changed, 8 insertions, 4 deletions
diff --git a/src/commands/cmd_motd.cpp b/src/commands/cmd_motd.cpp
index 9468eb2f3..b48c1c951 100644
--- a/src/commands/cmd_motd.cpp
+++ b/src/commands/cmd_motd.cpp
@@ -45,16 +45,19 @@ CmdResult CommandMotd::Handle (const std::vector<std::string>& parameters, User
{
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
return CMD_SUCCESS;
- if (!ServerInstance->Config->MOTD.size())
+
+ ConfigFileCache::iterator motd = ServerInstance->Config->Files.find("motd");
+ if (motd == ServerInstance->Config->Files.end())
{
user->SendText(":%s %03d %s :Message of the day file is missing.",
ServerInstance->Config->ServerName.c_str(), ERR_NOMOTD, user->nick.c_str());
return CMD_SUCCESS;
}
+
user->SendText(":%s %03d %s :%s message of the day", ServerInstance->Config->ServerName.c_str(),
RPL_MOTDSTART, user->nick.c_str(), ServerInstance->Config->ServerName.c_str());
- for (file_cache::iterator i = ServerInstance->Config->MOTD.begin(); i != ServerInstance->Config->MOTD.end(); i++)
+ for (file_cache::iterator i = motd->second.begin(); i != motd->second.end(); i++)
user->SendText(":%s %03d %s :- %s", ServerInstance->Config->ServerName.c_str(), RPL_MOTD, user->nick.c_str(),i->c_str());
user->SendText(":%s %03d %s :End of message of the day.", ServerInstance->Config->ServerName.c_str(), RPL_ENDOFMOTD, user->nick.c_str());
diff --git a/src/commands/cmd_rules.cpp b/src/commands/cmd_rules.cpp
index 78b3235fb..e1e44d51f 100644
--- a/src/commands/cmd_rules.cpp
+++ b/src/commands/cmd_rules.cpp
@@ -44,7 +44,8 @@ CmdResult CommandRules::Handle (const std::vector<std::string>& parameters, User
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
return CMD_SUCCESS;
- if (!ServerInstance->Config->RULES.size())
+ ConfigFileCache::iterator rules = ServerInstance->Config->Files.find("rules");
+ if (rules == ServerInstance->Config->Files.end())
{
user->SendText(":%s %03d %s :RULES file is missing.",
ServerInstance->Config->ServerName.c_str(), ERR_NORULES, user->nick.c_str());
@@ -53,7 +54,7 @@ CmdResult CommandRules::Handle (const std::vector<std::string>& parameters, User
user->SendText(":%s %03d %s :%s server rules:", ServerInstance->Config->ServerName.c_str(),
RPL_RULESTART, user->nick.c_str(), ServerInstance->Config->ServerName.c_str());
- for (file_cache::iterator i = ServerInstance->Config->RULES.begin(); i != ServerInstance->Config->RULES.end(); i++)
+ for (file_cache::iterator i = rules->second.begin(); i != rules->second.end(); i++)
user->SendText(":%s %03d %s :- %s", ServerInstance->Config->ServerName.c_str(), RPL_RULES, user->nick.c_str(),i->c_str());
user->SendText(":%s %03d %s :End of RULES command.", ServerInstance->Config->ServerName.c_str(), RPL_RULESEND, user->nick.c_str());