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 extern InspIRCd* ServerInstance;
32 class ModuleSecureList : public Module
37 ModuleSecureList(InspIRCd* Me) : Module::Module(Me)
42 virtual ~ModuleSecureList()
46 virtual Version GetVersion()
48 return Version(1,0,0,0,VF_VENDOR);
51 void Implements(char* List)
53 List[I_OnPreCommand] = List[I_On005Numeric] = 1;
58 * Intercept the LIST command.
60 virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
62 /* If the command doesnt appear to be valid, we dont want to mess with it. */
66 if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper))
68 user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
69 /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't
70 * receive these numerics whenever they send LIST, so give them an empty LIST to mull over.
72 user->WriteServ("321 %s Channel :Users Name",user->nick);
73 user->WriteServ("323 %s :End of channel list.",user->nick);
79 virtual void On005Numeric(std::string &output)
81 output.append(" SECURELIST");
84 virtual Priority Prioritize()
86 return (Priority)ServerInstance->PriorityBefore("m_safelist.so");
93 /******************************************************************************************************/
95 class ModuleSecureListFactory : public ModuleFactory
98 ModuleSecureListFactory()
102 ~ModuleSecureListFactory()
106 virtual Module * CreateModule(InspIRCd* Me)
108 return new ModuleSecureList(Me);
113 extern "C" void * init_module( void )
115 return new ModuleSecureListFactory;