X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_alltime.cpp;h=73c0fa994f0443e2819d6b7df83c063db4b24863;hb=3b78613576364c4ac6a4e4af43a2eea056c8dd3f;hp=d0331a99457f6c940af426c01850a8132e9c5adb;hpb=4b41feea830fc84e8c1b2fd0982f3e8d8840af96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index d0331a994..73c0fa994 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -21,26 +21,21 @@ #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 ¶meters, User *user) { - 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; @@ -61,11 +56,6 @@ class Modulealltime : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(mycommand); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Display timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR);