]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alltime.cpp
Attach to events and register services in init()
[user/henk/code/inspircd.git] / src / modules / m_alltime.cpp
index 29a0ee42c6ddc63a8959f3994fb2d96585710603..682e94cd8b2e3e445f1975111ddbcb7f1491c681 100644 (file)
@@ -38,7 +38,7 @@ class CommandAlltime : public Command
                time_t now = ServerInstance->Time();
                strftime(fmtdate, sizeof(fmtdate), "%Y-%m-%d %H:%M:%S", gmtime(&now));
 
-               std::string msg = ":" + std::string(ServerInstance->Config->ServerName.c_str()) + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;
+               std::string msg = ":" + ServerInstance->Config->ServerName + " NOTICE " + user->nick + " :System time is " + fmtdate + " (" + ConvToStr(ServerInstance->Time()) + ") on " + ServerInstance->Config->ServerName;
 
                user->SendText(msg);
 
@@ -59,6 +59,10 @@ class Modulealltime : public Module
  public:
        Modulealltime()
                : mycommand(this)
+       {
+       }
+
+       void init()
        {
                ServerInstance->AddCommand(&mycommand);
        }