1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
21 /* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */
23 class ModuleSecureList : public Module
28 ModuleSecureList(InspIRCd* Me) : Module::Module(Me)
33 virtual ~ModuleSecureList()
37 virtual Version GetVersion()
39 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
42 void Implements(char* List)
44 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
49 * Intercept the LIST command.
51 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line)
53 /* If the command doesnt appear to be valid, we dont want to mess with it. */
57 if ((command == "LIST") && (ServerInstance->Time() < (user->signon+60)) && (!*user->oper))
59 user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
60 /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
61 * receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
63 user->WriteServ("321 %s Channel :Users Name",user->nick);
64 user->WriteServ("323 %s :End of channel list.",user->nick);
70 virtual void On005Numeric(std::string &output)
72 output.append(" SECURELIST");
75 virtual Priority Prioritize()
77 return (Priority)ServerInstance->PriorityBefore("m_safelist.so");
84 /******************************************************************************************************/
86 class ModuleSecureListFactory : public ModuleFactory
89 ModuleSecureListFactory()
93 ~ModuleSecureListFactory()
97 virtual Module * CreateModule(InspIRCd* Me)
99 return new ModuleSecureList(Me);
104 extern "C" void * init_module( void )
106 return new ModuleSecureListFactory;