// minor tweak - we cant have signon time shorter than our idle time!
if (user->signon > user->idle_lastmsg)
user->signon = user->idle_lastmsg;
// 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(std::string(parameters[0])))+" seconds");
- user->WriteServ("944 %s :Idle time set.",user->nick);
+ ServerInstance->SNO->WriteToSnoMask('a', std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds");
+ user->WriteNumeric(944, "%s :Idle time set.",user->nick.c_str());
return CMD_SUCCESS;
}
return CMD_SUCCESS;
}
@@ -58,50+48,22 @@ class cmd_setidle : public command_t
class ModuleSetIdle : public Module
{
class ModuleSetIdle : public Module
{
- cmd_setidle* mycommand;
+ CommandSetidle cmd;
public:
public:
- ModuleSetIdle(InspIRCd* Me)
- : Module::Module(Me)
+ ModuleSetIdle()
+ : cmd(this)
{
{
-
- mycommand = new cmd_setidle(ServerInstance);
- ServerInstance->AddCommand(mycommand);
+ ServerInstance->AddCommand(&cmd);
}
}
-
+
virtual ~ModuleSetIdle()
{
}
virtual ~ModuleSetIdle()
{
}
-
- virtual Version GetVersion()
- {
- return Version(1,0,0,1,VF_VENDOR);
- }
-
-};
-// stuff down here is the module-factory stuff. For basic modules you can ignore this.
-
-class ModuleSetIdleFactory : public ModuleFactory
-{
- public:
- ModuleSetIdleFactory()
- {
- }
-
- ~ModuleSetIdleFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
+ virtual Version GetVersion()
{
{
- return new ModuleSetIdle(Me);
+ return Version("Allows opers to set their idle time", VF_VENDOR, API_VERSION);