#include "core_info.h"
CommandMotd::CommandMotd(Module* parent)
- : Command(parent, "MOTD", 0, 1)
+ : ServerTargetCommand(parent, "MOTD")
{
syntax = "[<servername>]";
}
/** Handle /MOTD
*/
-CmdResult CommandMotd::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandMotd::Handle(User* user, const Params& parameters)
{
if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
{
if (localuser)
tag = localuser->GetClass()->config;
std::string motd_name = tag->getString("motd", "motd");
- ConfigFileCache::iterator motd = ServerInstance->Config->Files.find(motd_name);
- if (motd == ServerInstance->Config->Files.end())
+ ConfigFileCache::iterator motd = motds.find(motd_name);
+ if (motd == motds.end())
{
user->WriteRemoteNumeric(ERR_NOMOTD, "Message of the day file is missing.");
return CMD_SUCCESS;
return CMD_SUCCESS;
}
-
-RouteDescriptor CommandMotd::GetRouting(User* user, const std::vector<std::string>& parameters)
-{
- if (parameters.size() > 0)
- return ROUTE_UNICAST(parameters[0]);
- return ROUTE_LOCALONLY;
-}