]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_info/cmd_time.cpp
Fix the base path being used for more than just the install prefix.
[user/henk/code/inspircd.git] / src / coremods / core_info / cmd_time.cpp
index a0b58efcc24280413b26bc453452d5e7a033b59b..a880d7a0ef888708eefd3cd0522151f2e99517a8 100644 (file)
@@ -1,8 +1,13 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2014, 2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006, 2010 Craig Edwards <brain@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
 #include "core_info.h"
 
 CommandTime::CommandTime(Module* parent)
-       : Command(parent, "TIME", 0, 0)
+       : ServerTargetCommand(parent, "TIME")
 {
        syntax = "[<servername>]";
 }
 
-CmdResult CommandTime::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandTime::Handle(User* user, const Params& parameters)
 {
-       if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName)
+       if (parameters.size() > 0 && !irc::equals(parameters[0], ServerInstance->Config->ServerName))
                return CMD_SUCCESS;
 
-       user->WriteRemoteNumeric(RPL_TIME, ServerInstance->Config->ServerName, InspIRCd::TimeString(ServerInstance->Time()));
-
+       user->WriteRemoteNumeric(RPL_TIME, ServerInstance->Config->GetServerName(), InspIRCd::TimeString(ServerInstance->Time()));
        return CMD_SUCCESS;
 }
-
-RouteDescriptor CommandTime::GetRouting(User* user, const std::vector<std::string>& parameters)
-{
-       if (parameters.size() > 0)
-               return ROUTE_UNICAST(parameters[0]);
-       return ROUTE_LOCALONLY;
-}