diff options
Diffstat (limited to 'src/modules/m_alltime.cpp')
-rw-r--r-- | src/modules/m_alltime.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 38ae4b254..de3e702ac 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -21,38 +21,32 @@ #include "inspircd.h" -/* $ModDesc: Display timestamps from all servers connected to the network */ - class CommandAlltime : public Command { public: CommandAlltime(Module* Creator) : Command(Creator, "ALLTIME", 0) { flags_needed = 'o'; - translation.push_back(TR_END); } - CmdResult Handle(const std::vector<std::string> ¶meters, User *user) + CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE { - char fmtdate[64]; - time_t now = ServerInstance->Time(); - strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now)); + const std::string fmtdate = InspIRCd::TimeString(ServerInstance->Time(), "%Y-%m-%d %H:%M:%S", true); - std::string msg = ":" + ServerInstance->Config->ServerName + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; + std::string msg = "System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName; - user->SendText(msg); + user->WriteRemoteNotice(msg); /* we want this routed out! */ return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) + RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE { return ROUTE_OPT_BCAST; } }; - class Modulealltime : public Module { CommandAlltime mycommand; @@ -62,16 +56,7 @@ class Modulealltime : public Module { } - void init() - { - ServerInstance->Modules->AddService(mycommand); - } - - virtual ~Modulealltime() - { - } - - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Display timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR); } |