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"
29 /* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */
31 class ModuleSecureList : public Module
36 ModuleSecureList(Server* Me) : Module::Module(Me)
41 virtual ~ModuleSecureList()
45 virtual Version GetVersion()
47 return Version(1,0,0,0,VF_VENDOR);
50 void Implements(char* List)
52 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
57 * Intercept the LIST command.
59 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
61 /* If the command doesnt appear to be valid, we dont want to mess with it. */
65 if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper))
67 user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
68 /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
69 * receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
71 user->WriteServ("321 %s Channel :Users Name",user->nick);
72 user->WriteServ("323 %s :End of channel list.",user->nick);
78 virtual void On005Numeric(std::string &output)
80 output.append(" SECURELIST");
83 virtual Priority Prioritize()
85 return (Priority)Srv->PriorityBefore("m_safelist.so");
92 /******************************************************************************************************/
94 class ModuleSecureListFactory : public ModuleFactory
97 ModuleSecureListFactory()
101 ~ModuleSecureListFactory()
105 virtual Module * CreateModule(Server* Me)
107 return new ModuleSecureList(Me);
112 extern "C" void * init_module( void )
114 return new ModuleSecureListFactory;