]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alltime.cpp
Try this as the ssl crash fix
[user/henk/code/inspircd.git] / src / modules / m_alltime.cpp
index 75ed4f35560cf6327d28f797dacd78c5d3a2fa9c..ad7002ae200949ca1c07314ea72675eee1d7cf34 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -25,26 +25,21 @@ class CommandAlltime : public Command
                translation.push_back(TR_END);
        }
 
-       CmdResult Handle(const char* const* parameters, int pcnt, User *user)
+       CmdResult Handle(const std::vector<std::string> &parameters, User *user)
        {
                char fmtdate[64];
                time_t now = ServerInstance->Time();
-               strftime(fmtdate, sizeof(fmtdate), "%F %T", gmtime(&now));
-               
-               std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time for " +
-                       ServerInstance->Config->ServerName + " is: " + fmtdate;
-               
+               strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now));
+
+               std::string msg = ":" + std::string(ServerInstance->Config->ServerName) + " NOTICE " + user->nick + " :System time is " + fmtdate + "(" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;
+
                if (IS_LOCAL(user))
                {
                        user->Write(msg);
                }
                else
                {
-                       std::deque<std::string> params;
-                       params.push_back(user->nick);
-                       params.push_back(msg);
-                       Event ev((char *) &params, NULL, "send_push");
-                       ev.Send(ServerInstance);
+                       ServerInstance->PI->PushToClient(user, ":" + msg);
                }
 
                /* we want this routed out! */
@@ -64,16 +59,16 @@ class Modulealltime : public Module
                ServerInstance->AddCommand(mycommand);
 
        }
-       
+
        virtual ~Modulealltime()
        {
        }
-       
+
        virtual Version GetVersion()
        {
-               return Version(1, 0, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
        }
-       
+
 };
 
 MODULE_INIT(Modulealltime)