1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
23 /* $ModDesc: Allows opers to set their idle time */
27 void handle_setidle(char **parameters, int pcnt, userrec *user)
29 user->idle_lastmsg = time(NULL) - atoi(parameters[0]);
30 // minor tweak - we cant have signon time shorter than our idle time!
31 if (user->signon > user->idle_lastmsg)
32 user->signon = user->idle_lastmsg;
33 Srv->SendOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+std::string(parameters[0])+" seconds");
34 WriteServ(user->fd,"944 %s :Idle time set.",user->nick);
38 class ModuleSetIdle : public Module
44 Srv->AddCommand("SETIDLE",handle_setidle,'o',1,"m_setidle.so");
47 virtual ~ModuleSetIdle()
53 virtual Version GetVersion()
55 return Version(1,0,0,1,VF_VENDOR);
60 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
62 class ModuleSetIdleFactory : public ModuleFactory
65 ModuleSetIdleFactory()
69 ~ModuleSetIdleFactory()
73 virtual Module * CreateModule()
75 return new ModuleSetIdle;
81 extern "C" void * init_module( void )
83 return new ModuleSetIdleFactory;