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 * ---------------------------------------------------
22 #include "helperfuncs.h"
28 /* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */
30 class ModuleSecureList : public Module
35 ModuleSecureList(Server* Me) : Module::Module(Me)
40 virtual ~ModuleSecureList()
44 virtual Version GetVersion()
46 return Version(1,0,0,0,VF_VENDOR);
49 void Implements(char* List)
51 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
56 * Intercept the LIST command.
58 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
60 /* If the command doesnt appear to be valid, we dont want to mess with it. */
64 if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper))
66 WriteServ(user->fd,"NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
67 /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
68 * receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
70 WriteServ(user->fd,"321 %s Channel :Users Name",user->nick);
71 WriteServ(user->fd,"323 %s :End of channel list.",user->nick);
77 virtual void On005Numeric(std::string &output)
79 output.append(" SECURELIST");
82 virtual Priority Prioritize()
84 return (Priority)Srv->PriorityBefore("m_safelist.so");
91 /******************************************************************************************************/
93 class ModuleSecureListFactory : public ModuleFactory
96 ModuleSecureListFactory()
100 ~ModuleSecureListFactory()
104 virtual Module * CreateModule(Server* Me)
106 return new ModuleSecureList(Me);
111 extern "C" void * init_module( void )
113 return new ModuleSecureListFactory;