]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_setidle.cpp
Unite SSL service providers and SSL profile classes
[user/henk/code/inspircd.git] / src / modules / m_setidle.cpp
index e246b801f1dfadaf401f19b888ec93f0b86bb084..6302b36544fd1d1a10bd3d2f61557f0fec436d6a 100644 (file)
 
 #include "inspircd.h"
 
+enum
+{
+       // InspIRCd-specific.
+       ERR_INVALIDIDLETIME = 948,
+       RPL_IDLETIMESET = 944
+};
+
 /** Handle /SETIDLE
  */
 class CommandSetidle : public SplitCommand
@@ -36,7 +43,7 @@ class CommandSetidle : public SplitCommand
                int idle = InspIRCd::Duration(parameters[0]);
                if (idle < 1)
                {
-                       user->WriteNumeric(948, "%s :Invalid idle time.",user->nick.c_str());
+                       user->WriteNumeric(ERR_INVALIDIDLETIME, "Invalid idle time.");
                        return CMD_FAILURE;
                }
                user->idle_lastmsg = (ServerInstance->Time() - idle);
@@ -44,7 +51,7 @@ class CommandSetidle : public SplitCommand
                if (user->signon > user->idle_lastmsg)
                        user->signon = user->idle_lastmsg;
                ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds");
-               user->WriteNumeric(944, "%s :Idle time set.",user->nick.c_str());
+               user->WriteNumeric(RPL_IDLETIMESET, "Idle time set.");
 
                return CMD_SUCCESS;
        }
@@ -60,11 +67,6 @@ class ModuleSetIdle : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Allows opers to set their idle time", VF_VENDOR);