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 * ---------------------------------------------------
19 /* $ModDesc: Sends the /LUSERS on connect */
23 // This has to be the simplest module ever.
24 // The RFC doesnt specify that you should send the /LUSERS numerics
25 // on connect, but someone asked for it, so its in a module.
27 class ModuleConnLUSERS : public Module
33 ModuleConnLUSERS(InspIRCd* Me)
39 virtual ~ModuleConnLUSERS()
43 virtual Version GetVersion()
45 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
48 void Implements(char* List)
50 List[I_OnUserConnect] = 1;
53 virtual void OnUserConnect(userrec* user)
55 // if we're using a protocol module, we cant just call
56 // the command handler because the protocol module
57 // has hooked it. We must call OnPreCommand in the
58 // protocol module. Yes, at some point there will
59 // be a way to get the current protocol module's name
60 // from the core and probably a pointer to its class.
61 Module* Proto = ServerInstance->FindModule("m_spanningtree.so");
64 Proto->OnPreCommand("LUSERS", NULL, 0, user, true, "LUSERS");
68 ServerInstance->CallCommandHandler("LUSERS", NULL, 0, user);
75 // The ModuleConnLUSERSFactory class inherits from ModuleFactory
76 // and creates a ModuleConnLUSERS object when requested.
79 class ModuleConnLUSERSFactory : public ModuleFactory
82 ModuleConnLUSERSFactory()
86 ~ModuleConnLUSERSFactory()
90 virtual Module * CreateModule(InspIRCd* Me)
92 return new ModuleConnLUSERS(Me);
99 // The "C" linkage factory0() function creates the ModuleConnLUSERSFactory
100 // class for this library
103 extern "C" void * init_module( void )
105 return new ModuleConnLUSERSFactory;