1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 * ---------------------------------------------------
26 /* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */
28 class ModuleSecureList : public Module
33 ModuleSecureList(InspIRCd* Me) : Module::Module(Me)
38 virtual ~ModuleSecureList()
42 virtual Version GetVersion()
44 return Version(1,1,0,0,VF_VENDOR,API_VERSION);
47 void Implements(char* List)
49 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
54 * Intercept the LIST command.
56 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated, const std::string &original_line)
58 /* If the command doesnt appear to be valid, we dont want to mess with it. */
62 if ((command == "LIST") && (ServerInstance->Time() < (user->signon+60)) && (!*user->oper))
64 user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
65 /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
66 * receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
68 user->WriteServ("321 %s Channel :Users Name",user->nick);
69 user->WriteServ("323 %s :End of channel list.",user->nick);
75 virtual void On005Numeric(std::string &output)
77 output.append(" SECURELIST");
80 virtual Priority Prioritize()
82 return (Priority)ServerInstance->PriorityBefore("m_safelist.so");
89 /******************************************************************************************************/
91 class ModuleSecureListFactory : public ModuleFactory
94 ModuleSecureListFactory()
98 ~ModuleSecureListFactory()
102 virtual Module * CreateModule(InspIRCd* Me)
104 return new ModuleSecureList(Me);
109 extern "C" void * init_module( void )
111 return new ModuleSecureListFactory;