diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-02 16:47:25 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-02 16:47:25 +0000 |
commit | f2256deeefe9a9f57f6f6b902604c01138ad16cc (patch) | |
tree | 2180cffd6bec0487e3d8b5a7d5894b258782e39c /src/commands/cmd_rules.cpp | |
parent | f288993a85681c09e3d92d8c3ab9742826923e99 (diff) |
Executable include for MOTD and more
This introduces an <execfiles> tag that reads files from the output of
a command, in the same way as executable includes. The files specified
here can also be used anywhere a file is used (opermotd, randquote, etc)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12354 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands/cmd_rules.cpp')
-rw-r--r-- | src/commands/cmd_rules.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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()); |