- user->idle_lastmsg = time(NULL) - atoi(parameters[0]);
- // minor tweak - we cant have signon time shorter than our idle time!
- if (user->signon > user->idle_lastmsg)
- user->signon = user->idle_lastmsg;
- Srv->SendOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+std::string(parameters[0])+" seconds");
- WriteServ(user->fd,"944 %s :Idle time set.",user->nick);
-}
+
+ CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+ {
+ if (atoi(parameters[0]) < 1)
+ {
+ user->WriteServ("948 %s :Invalid idle time.",user->nick);
+ return CMD_FAILURE;
+ }
+ user->idle_lastmsg = time(NULL) - atoi(parameters[0]);
+ // minor tweak - we cant have signon time shorter than our idle time!
+ if (user->signon > user->idle_lastmsg)
+ user->signon = user->idle_lastmsg;
+ ServerInstance->WriteOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(atoi(parameters[0]))+" seconds");
+ user->WriteServ("944 %s :Idle time set.",user->nick);
+
+ return CMD_SUCCESS;
+ }
+};