]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add Module* creator to Command and ModeHandler
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:48:48 +0000 (00:48 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:48:48 +0000 (00:48 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11631 e03df62e-2008-0410-955e-edbf42e46eb7

171 files changed:
include/command_parse.h
include/commands/cmd_admin.h
include/commands/cmd_away.h
include/commands/cmd_clearcache.h
include/commands/cmd_commands.h
include/commands/cmd_connect.h
include/commands/cmd_die.h
include/commands/cmd_eline.h
include/commands/cmd_gline.h
include/commands/cmd_info.h
include/commands/cmd_invite.h
include/commands/cmd_ison.h
include/commands/cmd_join.h
include/commands/cmd_kick.h
include/commands/cmd_kill.h
include/commands/cmd_kline.h
include/commands/cmd_links.h
include/commands/cmd_list.h
include/commands/cmd_loadmodule.h
include/commands/cmd_lusers.h
include/commands/cmd_map.h
include/commands/cmd_mode.h
include/commands/cmd_modules.h
include/commands/cmd_motd.h
include/commands/cmd_names.h
include/commands/cmd_nick.h
include/commands/cmd_notice.h
include/commands/cmd_oper.h
include/commands/cmd_part.h
include/commands/cmd_pass.h
include/commands/cmd_ping.h
include/commands/cmd_pong.h
include/commands/cmd_privmsg.h
include/commands/cmd_qline.h
include/commands/cmd_quit.h
include/commands/cmd_rehash.h
include/commands/cmd_reloadmodule.h
include/commands/cmd_restart.h
include/commands/cmd_rules.h
include/commands/cmd_server.h
include/commands/cmd_squit.h
include/commands/cmd_stats.h
include/commands/cmd_time.h
include/commands/cmd_topic.h
include/commands/cmd_trace.h
include/commands/cmd_unloadmodule.h
include/commands/cmd_user.h
include/commands/cmd_userhost.h
include/commands/cmd_version.h
include/commands/cmd_wallops.h
include/commands/cmd_who.h
include/commands/cmd_whois.h
include/commands/cmd_zline.h
include/ctables.h
include/mode.h
include/u_listmode.h
src/command_parse.cpp
src/commands/cmd_commands.cpp
src/commands/cmd_whowas.cpp
src/mode.cpp
src/modes/cmode_b.cpp
src/modes/cmode_h.cpp
src/modes/cmode_i.cpp
src/modes/cmode_k.cpp
src/modes/cmode_l.cpp
src/modes/cmode_m.cpp
src/modes/cmode_n.cpp
src/modes/cmode_o.cpp
src/modes/cmode_p.cpp
src/modes/cmode_s.cpp
src/modes/cmode_t.cpp
src/modes/cmode_v.cpp
src/modes/umode_i.cpp
src/modes/umode_o.cpp
src/modes/umode_s.cpp
src/modes/umode_w.cpp
src/modules.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/m_allowinvite.cpp
src/modules/m_alltime.cpp
src/modules/m_auditorium.cpp
src/modules/m_banexception.cpp
src/modules/m_banredirect.cpp
src/modules/m_blockcaps.cpp
src/modules/m_blockcolor.cpp
src/modules/m_botmode.cpp
src/modules/m_callerid.cpp
src/modules/m_cap.cpp
src/modules/m_cban.cpp
src/modules/m_censor.cpp
src/modules/m_cgiirc.cpp
src/modules/m_chanfilter.cpp
src/modules/m_chanprotect.cpp
src/modules/m_check.cpp
src/modules/m_chghost.cpp
src/modules/m_chgident.cpp
src/modules/m_chgname.cpp
src/modules/m_cloaking.cpp
src/modules/m_clones.cpp
src/modules/m_close.cpp
src/modules/m_commonchans.cpp
src/modules/m_customtitle.cpp
src/modules/m_cycle.cpp
src/modules/m_dccallow.cpp
src/modules/m_deaf.cpp
src/modules/m_delayjoin.cpp
src/modules/m_delaymsg.cpp
src/modules/m_devoice.cpp
src/modules/m_filter.cpp
src/modules/m_globalload.cpp
src/modules/m_globops.cpp
src/modules/m_helpop.cpp
src/modules/m_hidechans.cpp
src/modules/m_hideoper.cpp
src/modules/m_invisible.cpp
src/modules/m_inviteexception.cpp
src/modules/m_joinflood.cpp
src/modules/m_jumpserver.cpp
src/modules/m_kicknorejoin.cpp
src/modules/m_knock.cpp
src/modules/m_lockserv.cpp
src/modules/m_messageflood.cpp
src/modules/m_nickflood.cpp
src/modules/m_nicklock.cpp
src/modules/m_noctcp.cpp
src/modules/m_nokicks.cpp
src/modules/m_nonicks.cpp
src/modules/m_nonotice.cpp
src/modules/m_operchans.cpp
src/modules/m_opermotd.cpp
src/modules/m_operprefix.cpp
src/modules/m_password_hash.cpp
src/modules/m_permchannels.cpp
src/modules/m_randquote.cpp
src/modules/m_redirect.cpp
src/modules/m_remove.cpp
src/modules/m_rline.cpp
src/modules/m_sajoin.cpp
src/modules/m_sakick.cpp
src/modules/m_samode.cpp
src/modules/m_sanick.cpp
src/modules/m_sapart.cpp
src/modules/m_saquit.cpp
src/modules/m_sasl.cpp
src/modules/m_satopic.cpp
src/modules/m_services_account.cpp
src/modules/m_servprotect.cpp
src/modules/m_sethost.cpp
src/modules/m_setident.cpp
src/modules/m_setidle.cpp
src/modules/m_setname.cpp
src/modules/m_showwhois.cpp
src/modules/m_shun.cpp
src/modules/m_silence.cpp
src/modules/m_spanningtree/postcommand.cpp
src/modules/m_spanningtree/rconnect.cpp
src/modules/m_spanningtree/rconnect.h
src/modules/m_spanningtree/rsquit.cpp
src/modules/m_spanningtree/rsquit.h
src/modules/m_sslinfo.cpp
src/modules/m_sslmodes.cpp
src/modules/m_stripcolor.cpp
src/modules/m_svshold.cpp
src/modules/m_swhois.cpp
src/modules/m_taxonomy.cpp
src/modules/m_timedbans.cpp
src/modules/m_tline.cpp
src/modules/m_uninvite.cpp
src/modules/m_userip.cpp
src/modules/m_vhost.cpp
src/modules/m_watch.cpp

index 2cf403de1199b8cf294198bfc38148d2fbde3694..f176394a7526e784b1b23e0c3c7f9822cc8895ae 100644 (file)
@@ -68,7 +68,7 @@ class CoreExport CommandParser : public classbase
        /** Removes a command if the sources match. Used as a helper for
         *  safe hash_map delete while iter in RemoveCommands(const char* source).
         */
-       void RemoveCommand(nspace::hash_map<std::string,Command*>::iterator safei, const char* source);
+       void RemoveCommand(nspace::hash_map<std::string,Command*>::iterator safei, Module* source);
 
 
  public:
@@ -178,9 +178,9 @@ class CoreExport CommandParser : public classbase
        void DoLines(User* current, bool one_only = false);
 
        /** Remove all commands relating to module 'source'.
-        * @param source A module name which has introduced new commands
+        * @param source A module which has introduced new commands
         */
-       void RemoveCommands(const char* source);
+       void RemoveCommands(Module* source);
 
        /** Remove all core commands and unload their shared objects
         */
@@ -226,7 +226,7 @@ class CommandReload : public Command
  public:
        /** Standard constructor
         */
-       CommandReload (InspIRCd* Instance) : Command(Instance,"RELOAD","o",1) { syntax = "<core-command>"; }
+       CommandReload (InspIRCd* Instance) : Command(Instance,NULL,"RELOAD","o",1) { syntax = "<core-command>"; }
        /** Handle RELOAD
         */
        CmdResult Handle(const std::vector<std::string>& parameters, User *user);
index 25a77e84581d2ce252024952037e357dc355cffb..b82331c39e8d806403278dccd88d9345934e2255 100644 (file)
@@ -27,7 +27,7 @@ class CommandAdmin : public Command
  public:
        /** Constructor for admin.
         */
-       CommandAdmin (InspIRCd* Instance) : Command(Instance,"ADMIN",0,0) { syntax = "[<servername>]"; }
+       CommandAdmin (InspIRCd* Instance) : Command(Instance,NULL,"ADMIN",0,0) { syntax = "[<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index f6d1bc783c1e0eebbbf8ddefaf616c3a72844d5a..9cde32f57a429783e3671f48e1fd6d45bb1d1d3b 100644 (file)
@@ -29,7 +29,7 @@ class CommandAway : public Command
  public:
        /** Constructor for away.
         */
-       CommandAway (InspIRCd* Instance) : Command(Instance,"AWAY",0,0) { syntax = "[<message>]"; }
+       CommandAway (InspIRCd* Instance) : Command(Instance,NULL,"AWAY",0,0) { syntax = "[<message>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 559c8cd456e7d5d5723063d17e320b12f75cddc7..00e41fce9613802a89c93966b296f7c688b72d18 100644 (file)
@@ -28,7 +28,7 @@ class CommandClearcache : public Command
  public:
        /** Constructor for clearcache.
         */
-       CommandClearcache (InspIRCd* Instance) : Command(Instance,"CLEARCACHE","o",0) { }
+       CommandClearcache (InspIRCd* Instance) : Command(Instance,NULL,"CLEARCACHE","o",0) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index dbc7a162c9c59fa14e82e48e9fe77bf841e3026b..13c5ee075e28e56c4c51c0c5667089395d65f57d 100644 (file)
@@ -29,7 +29,7 @@ class CommandCommands : public Command
  public:
        /** Constructor for commands.
         */
-       CommandCommands (InspIRCd* Instance) : Command(Instance,"COMMANDS",0,0) { }
+       CommandCommands (InspIRCd* Instance) : Command(Instance,NULL,"COMMANDS",0,0) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index d7543a2155aaec0790e694a2501e1f09991a88bd..208844661c29d50fed522308c1e459935f13995e 100644 (file)
@@ -29,7 +29,7 @@ class CommandConnect : public Command
  public:
        /** Constructor for connect.
         */
-       CommandConnect (InspIRCd* Instance) : Command(Instance,"CONNECT","o",1,false,0) { syntax = "<servername> [<remote-server>]"; }
+       CommandConnect (InspIRCd* Instance) : Command(Instance,NULL,"CONNECT","o",1,false,0) { syntax = "<servername> [<remote-server>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 42cb1860d974aea7507a337e252807800860008f..156a1508ed96ae55309c8b4e71e498121c2aadf2 100644 (file)
@@ -29,7 +29,7 @@ class CommandDie : public Command
  public:
        /** Constructor for die.
         */
-       CommandDie (InspIRCd* Instance) : Command(Instance,"DIE","o",1,false,0) { syntax = "<password>"; }
+       CommandDie (InspIRCd* Instance) : Command(Instance,NULL,"DIE","o",1,false,0) { syntax = "<password>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 7af325515e85e32b02833a46a560b96769d168bd..2ac9adeab62f6de4fc79d801af2b78cd39dab20d 100644 (file)
@@ -29,7 +29,7 @@ class CommandEline : public Command
  public:
        /** Constructor for eline.
         */
-       CommandEline (InspIRCd* Instance) : Command(Instance,"ELINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
+       CommandEline (InspIRCd* Instance) : Command(Instance,NULL,"ELINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 2a41d0f73b3aecd4825b5a0787b7ea1c55f52cc1..9548279d49c3f7e76ec49fe93a32ce5035f93316 100644 (file)
@@ -29,7 +29,7 @@ class CommandGline : public Command
  public:
        /** Constructor for gline.
         */
-       CommandGline (InspIRCd* Instance) : Command(Instance,"GLINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
+       CommandGline (InspIRCd* Instance) : Command(Instance,NULL,"GLINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 4c2cd1b5065682b77033b1a9822ab2f2fcc6f92f..85d7d4c84f0851d5a7ca9f76bfc02b65bf04121f 100644 (file)
@@ -29,7 +29,7 @@ class CommandInfo : public Command
  public:
        /** Constructor for info.
         */
-       CommandInfo (InspIRCd* Instance) : Command(Instance,"INFO",0,0) { syntax = "[<servermask>]"; }
+       CommandInfo (InspIRCd* Instance) : Command(Instance,NULL,"INFO",0,0) { syntax = "[<servermask>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 4f36e1a57c30c50c6a2a9c515b67d8b7d2826a2d..ce048e7128dd6b2bd27e5dd4bc084e6b6fc280be 100644 (file)
@@ -29,7 +29,7 @@ class CommandInvite : public Command
  public:
        /** Constructor for invite.
         */
-       CommandInvite (InspIRCd* Instance) : Command(Instance,"INVITE", 0, 0, false, 4) { syntax = "[<nick> <channel>]"; }
+       CommandInvite (InspIRCd* Instance) : Command(Instance,NULL,"INVITE", 0, 0, false, 4) { syntax = "[<nick> <channel>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 46810665e6c5c082821755356771e62568e2ccf4..93f3356d8c2c92039c478acaf24f507e9333f1b0 100644 (file)
@@ -29,7 +29,7 @@ class CommandIson : public Command
  public:
        /** Constructor for ison.
         */
-       CommandIson (InspIRCd* Instance) : Command(Instance,"ISON",0,0) { syntax = "<nick> {nick}"; }
+       CommandIson (InspIRCd* Instance) : Command(Instance,NULL,"ISON",0,0) { syntax = "<nick> {nick}"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 21caa04c1c5e676016e0c2703e838d9f36b3c092..2ea32de1a9567f292497d683b479477c606b80f7 100644 (file)
@@ -29,7 +29,7 @@ class CommandJoin : public Command
  public:
        /** Constructor for join.
         */
-       CommandJoin (InspIRCd* Instance) : Command(Instance,"JOIN", 0, 1, false, 2) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; }
+       CommandJoin (InspIRCd* Instance) : Command(Instance,NULL,"JOIN", 0, 1, false, 2) { syntax = "<channel>{,<channel>} {<key>{,<key>}}"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 716f1e22189bfaa9af20500a67d35bef19aa1165..be6a40b0676eb39057300e6f43fca05625db8082 100644 (file)
@@ -29,7 +29,7 @@ class CommandKick : public Command
  public:
        /** Constructor for kick.
         */
-       CommandKick (InspIRCd* Instance) : Command(Instance,"KICK",0,2) { syntax = "<channel> <nick>{,<nick>} [<reason>]"; }
+       CommandKick (InspIRCd* Instance) : Command(Instance,NULL,"KICK",0,2) { syntax = "<channel> <nick>{,<nick>} [<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index ab677fc8ef2826158f2fdaedb2fe2d4155818398..392975fab64bb1b4741264a7b18b83c3b956d791 100644 (file)
@@ -29,7 +29,7 @@ class CommandKill : public Command
  public:
        /** Constructor for kill.
         */
-       CommandKill (InspIRCd* Instance) : Command(Instance,"KILL","o",2,false,0) { syntax = "<nickname> <reason>"; }
+       CommandKill (InspIRCd* Instance) : Command(Instance,NULL,"KILL","o",2,false,0) { syntax = "<nickname> <reason>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index fca83aa460095a5764acd219e9dfbd3c199063c5..5744de506de204d802cc889d9e03a0f42acecf6a 100644 (file)
@@ -29,7 +29,7 @@ class CommandKline : public Command
  public:
        /** Constructor for kline.
         */
-       CommandKline (InspIRCd* Instance) : Command(Instance,"KLINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
+       CommandKline (InspIRCd* Instance) : Command(Instance,NULL,"KLINE","o",1,3,false,0) { syntax = "<ident@host> [<duration> :<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index e71d178349681883c7670cddd3b2b70afe1d7075..fbfdb6201143abf3fe04c040a95bdd7704ff1a29 100644 (file)
@@ -29,7 +29,7 @@ class CommandLinks : public Command
  public:
        /** Constructor for links.
         */
-       CommandLinks (InspIRCd* Instance) : Command(Instance,"LINKS",0,0) { }
+       CommandLinks (InspIRCd* Instance) : Command(Instance,NULL,"LINKS",0,0) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 18cc6d299081c7890048dd85b81e382bf5e4ddcb..8801b8c399623efa68e3446eeea61031c8638671 100644 (file)
@@ -29,7 +29,7 @@ class CommandList : public Command
  public:
        /** Constructor for list.
         */
-       CommandList (InspIRCd* Instance) : Command(Instance,"LIST", 0, 0, false, 5) { }
+       CommandList (InspIRCd* Instance) : Command(Instance,NULL,"LIST", 0, 0, false, 5) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index b48c11dfbfb05fd82907b43166d5e2f030d23e33..9d31f072b070b7d13aab34c3162efad66f2e5c09 100644 (file)
@@ -29,7 +29,7 @@ class CommandLoadmodule : public Command
  public:
        /** Constructor for loadmodule.
         */
-       CommandLoadmodule (InspIRCd* Instance) : Command(Instance,"LOADMODULE","o",1) { syntax = "<modulename>"; }
+       CommandLoadmodule (InspIRCd* Instance) : Command(Instance,NULL,"LOADMODULE","o",1) { syntax = "<modulename>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index eab09b1a5ef52b990f558f769e100e0f2f38a0d3..2c5d3d454a2722b703c72d6ed867160e928fe437 100644 (file)
@@ -29,7 +29,7 @@ class CommandLusers : public Command
  public:
        /** Constructor for lusers.
         */
-       CommandLusers (InspIRCd* Instance) : Command(Instance,"LUSERS",0,0) { }
+       CommandLusers (InspIRCd* Instance) : Command(Instance,NULL,"LUSERS",0,0) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index b825bf18aa5d8ba5118aa64ccfb37cfa757f39e1..183d597517dc23b18d1034b06d15d8c08cfd24fb 100644 (file)
@@ -29,7 +29,7 @@ class CommandMap : public Command
  public:
        /** Constructor for map.
         */
-       CommandMap (InspIRCd* Instance) : Command(Instance,"MAP",0,0,false,2) { }
+       CommandMap (InspIRCd* Instance) : Command(Instance,NULL,"MAP",0,0,false,2) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 3c6eda5f5841382585ec2d5bc5c64a4766165753..83ab00bba743b1ea5b6d0e722a5800c6951d7344 100644 (file)
@@ -28,7 +28,7 @@ class CommandMode : public Command
  public:
        /** Constructor for mode.
         */
-       CommandMode (InspIRCd* Instance) : Command(Instance,"MODE",0,1) { syntax = "<target> <modes> {<mode-parameters>}"; }
+       CommandMode (InspIRCd* Instance) : Command(Instance,NULL,"MODE",0,1) { syntax = "<target> <modes> {<mode-parameters>}"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index eb79f705f16c8c53c856cb72cbd321f26f251b4d..18dc76cac09c6c5449a80523318aab1d04d1c81b 100644 (file)
@@ -29,7 +29,7 @@ class CommandModules : public Command
  public:
        /** Constructor for modules.
         */
-       CommandModules (InspIRCd* Instance) : Command(Instance,"MODULES",0,0) { syntax = "[debug]"; }
+       CommandModules (InspIRCd* Instance) : Command(Instance,NULL,"MODULES",0,0) { syntax = "[debug]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 4ecebc12f5baa66d4a21d26b76f9f526dcbd069f..b57d851d9d75ad8af86012e453ddf3847d772bdc 100644 (file)
@@ -32,7 +32,7 @@ class CommandMotd : public Command
  public:
        /** Constructor for motd.
         */
-       CommandMotd (InspIRCd* Instance) : Command(Instance,"MOTD",0,0) { syntax = "[<servername>]"; }
+       CommandMotd (InspIRCd* Instance) : Command(Instance,NULL,"MOTD",0,0) { syntax = "[<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index bf31dd5bbdd6d6618ea1898b7a35958ff3449e4d..174b6aa20daaa4d4fbfd4fabc3912301662485c6 100644 (file)
@@ -29,7 +29,7 @@ class CommandNames : public Command
  public:
        /** Constructor for names.
         */
-       CommandNames (InspIRCd* Instance) : Command(Instance,"NAMES",0,0) { syntax = "{<channel>{,<channel>}}"; }
+       CommandNames (InspIRCd* Instance) : Command(Instance,NULL,"NAMES",0,0) { syntax = "{<channel>{,<channel>}}"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 566e94754adf918e9f3367cb9676796a673434fc..b3a8e12a87aa846d80538d839239bc1a51c9a81d 100644 (file)
@@ -30,7 +30,7 @@ class CommandNick : public Command
  public:
        /** Constructor for nick.
         */
-       CommandNick (InspIRCd* Instance) : Command(Instance,"NICK", 0, 1, true, 3), allowinvalid(false) { syntax = "<newnick>"; }
+       CommandNick (InspIRCd* Instance) : Command(Instance,NULL,"NICK", 0, 1, true, 3), allowinvalid(false) { syntax = "<newnick>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index d83ca212135118dee639e8994f8f7fea803702f2..580376f08cefdeee1353d64151634aede6090818 100644 (file)
@@ -29,7 +29,7 @@ class CommandNotice : public Command
  public:
        /** Constructor for notice.
         */
-       CommandNotice (InspIRCd* Instance) : Command(Instance,"NOTICE",0,2) { syntax = "<target>{,<target>} <message>"; }
+       CommandNotice (InspIRCd* Instance) : Command(Instance,NULL,"NOTICE",0,2) { syntax = "<target>{,<target>} <message>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 90bfee1629a0e34c0911b89f842520c8a063432e..dd0b6318dd47b4af11a38e30cdb3f2afe97f20a6 100644 (file)
@@ -31,7 +31,7 @@ class CommandOper : public Command
  public:
        /** Constructor for oper.
         */
-       CommandOper (InspIRCd* Instance) : Command(Instance,"OPER",0,2,false,2) { syntax = "<username> <password>"; }
+       CommandOper (InspIRCd* Instance) : Command(Instance,NULL,"OPER",0,2,false,2) { syntax = "<username> <password>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index dfee41d9dcdb9dd56e944be5f882a5de32155f68..01284ccbdd936a4b1b85e0dbf522e5b1976d277a 100644 (file)
@@ -29,7 +29,7 @@ class CommandPart : public Command
  public:
        /** Constructor for part.
         */
-       CommandPart (InspIRCd* Instance) : Command(Instance,"PART", 0, 1, false, 5) { syntax = "<channel>{,<channel>} [<reason>]"; }
+       CommandPart (InspIRCd* Instance) : Command(Instance,NULL,"PART", 0, 1, false, 5) { syntax = "<channel>{,<channel>} [<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 0f24ff293f43307f252f32b1ea3f01bc4af2ae73..21eb378ab5e107515b3580d459bb534f262fcebc 100644 (file)
@@ -32,7 +32,7 @@ class CommandPass : public Command
  public:
        /** Constructor for pass.
         */
-       CommandPass (InspIRCd* Instance) : Command(Instance,"PASS",0,1,true,0) { syntax = "<password>"; }
+       CommandPass (InspIRCd* Instance) : Command(Instance,NULL,"PASS",0,1,true,0) { syntax = "<password>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 5030aa775aaff372b9b86aeba4edd7500194dfb6..56570d24ebe6bd725aa405e1bbe130955cc9a96e 100644 (file)
@@ -29,7 +29,7 @@ class CommandPing : public Command
  public:
        /** Constructor for ping.
         */
-       CommandPing (InspIRCd* Instance) : Command(Instance,"PING", 0, 1, false, 0) { syntax = "<servername> [:<servername>]"; }
+       CommandPing (InspIRCd* Instance) : Command(Instance,NULL,"PING", 0, 1, false, 0) { syntax = "<servername> [:<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index bcf4fe8074e09eab19766e87ace6cc8a27e114c1..58d862a7356ed6f47dd3af3ecf80d8073bfc2145 100644 (file)
@@ -30,7 +30,7 @@ class CommandPong : public Command
  public:
        /** Constructor for pong.
         */
-       CommandPong (InspIRCd* Instance) : Command(Instance,"PONG", 0, 1, false, 0) { syntax = "<ping-text>"; }
+       CommandPong (InspIRCd* Instance) : Command(Instance,NULL,"PONG", 0, 1, false, 0) { syntax = "<ping-text>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 4fcc8284ce8e1cc608c36866101fce633423250c..74990983c2f572d3c6acc13f437ffd9a8733072b 100644 (file)
@@ -29,7 +29,7 @@ class CommandPrivmsg : public Command
  public:
        /** Constructor for privmsg.
         */
-       CommandPrivmsg (InspIRCd* Instance) : Command(Instance,"PRIVMSG",0,2) { syntax = "<target>{,<target>} <message>"; }
+       CommandPrivmsg (InspIRCd* Instance) : Command(Instance,NULL,"PRIVMSG",0,2) { syntax = "<target>{,<target>} <message>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index f36535cb175defa4cdcc36942fbb124e9d89992f..352ebddda020e4622d07344c5de02d9b3f3ee5be 100644 (file)
@@ -29,7 +29,7 @@ class CommandQline : public Command
  public:
        /** Constructor for qline.
         */
-       CommandQline (InspIRCd* Instance) : Command(Instance,"QLINE","o",1,3,false,0) { syntax = "<nick> [<duration> :<reason>]"; }
+       CommandQline (InspIRCd* Instance) : Command(Instance,NULL,"QLINE","o",1,3,false,0) { syntax = "<nick> [<duration> :<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 62a3a59e36cf9cd2b6498cc2469351fbae170e63..f1430e46bdb007ea95a50e3edb46600163252ae1 100644 (file)
@@ -29,7 +29,7 @@ class CommandQuit : public Command
  public:
        /** Constructor for quit.
         */
-       CommandQuit (InspIRCd* Instance) : Command(Instance,"QUIT",0,0,true) { syntax = "[<message>]"; }
+       CommandQuit (InspIRCd* Instance) : Command(Instance,NULL,"QUIT",0,0,true) { syntax = "[<message>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 6b35c2ae5bfa05d8b81b690bd9d19316d1ae7116..6c294ffb0acf1b47199a910df73a9c19f6edb7f9 100644 (file)
@@ -29,7 +29,7 @@ class CommandRehash : public Command
  public:
        /** Constructor for rehash.
         */
-       CommandRehash (InspIRCd* Instance) : Command(Instance,"REHASH","o",0,false,3) { syntax = "[<servermask>]"; }
+       CommandRehash (InspIRCd* Instance) : Command(Instance,NULL,"REHASH","o",0,false,3) { syntax = "[<servermask>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index f76106ebfc9ec27e34594165dd916289280385db..d75ec568f33cd994414e9d12b143918063427f24 100644 (file)
@@ -29,7 +29,7 @@ class CommandReloadmodule : public Command
  public:
        /** Constructor for reloadmodule.
         */
-       CommandReloadmodule (InspIRCd* Instance) : Command(Instance,"RELOADMODULE","o",1) { syntax = "<modulename>"; }
+       CommandReloadmodule (InspIRCd* Instance) : Command(Instance,NULL,"RELOADMODULE","o",1) { syntax = "<modulename>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index ab7986ab7be20c69af0d8a06e29ede65703d78a4..cd55ed15d7ee6769555e162e69a661021dbe6b4d 100644 (file)
@@ -32,7 +32,7 @@ class CommandRestart : public Command
  public:
        /** Constructor for restart.
         */
-       CommandRestart (InspIRCd* Instance) : Command(Instance,"RESTART","o",1,false,0) { syntax = "<password>"; }
+       CommandRestart (InspIRCd* Instance) : Command(Instance,NULL,"RESTART","o",1,false,0) { syntax = "<password>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 533ee2a373e6adf06f51bfde7669e62ebbdbd132..f0d6a395ff03a6983406bf536b30b88ec70d6f39 100644 (file)
@@ -32,7 +32,7 @@ class CommandRules : public Command
  public:
        /** Constructor for rules.
         */
-       CommandRules (InspIRCd* Instance) : Command(Instance,"RULES",0,0) { syntax = "[<servername>]"; }
+       CommandRules (InspIRCd* Instance) : Command(Instance,NULL,"RULES",0,0) { syntax = "[<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 5f69adcffc37fcfe41e823063f236f11826729c4..f3469552ddac9cc1c9066a8e5894845cf3ca0c6f 100644 (file)
@@ -29,7 +29,7 @@ class CommandServer : public Command
  public:
        /** Constructor for server.
         */
-       CommandServer (InspIRCd* Instance) : Command(Instance,"SERVER",0,0,true) { }
+       CommandServer (InspIRCd* Instance) : Command(Instance,NULL,"SERVER",0,0,true) { }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index b9b9c0188dda149a47af9dda0187e73e836a028e..6090831beb6ee4473957aaf9cd1829a3f5efdb21 100644 (file)
@@ -32,7 +32,7 @@ class CommandSquit : public Command
  public:
        /** Constructor for squit.
         */
-       CommandSquit (InspIRCd* Instance) : Command(Instance,"SQUIT","o",1) { syntax = "<servername> [<reason>]"; }
+       CommandSquit (InspIRCd* Instance) : Command(Instance,NULL,"SQUIT","o",1) { syntax = "<servername> [<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 70791670fe7eebe6e22cd5a0bc148fea11568f89..8df7def88be6dbed34b2ba1f69296f9db7da1dba 100644 (file)
@@ -32,7 +32,7 @@ class CommandStats : public Command
  public:
        /** Constructor for stats.
         */
-       CommandStats (InspIRCd* Instance) : Command(Instance,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; }
+       CommandStats (InspIRCd* Instance) : Command(Instance,NULL,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 78cd8f1afb6c7684dce8120e0e7b49f7f81ccd4b..6886189010bb1645162132c73361f5599c57d4d5 100644 (file)
@@ -29,7 +29,7 @@ class CommandTime : public Command
  public:
        /** Constructor for time.
         */
-       CommandTime (InspIRCd* Instance) : Command(Instance,"TIME",0,0) { syntax = "[<servername>]"; }
+       CommandTime (InspIRCd* Instance) : Command(Instance,NULL,"TIME",0,0) { syntax = "[<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index e03ea28ee483136cb3a7050a2372f5bbb80416e6..dc5ce1c7701ddc6565d6b2389e60e7b07adf0d6d 100644 (file)
@@ -29,7 +29,7 @@ class CommandTopic : public Command
  public:
        /** Constructor for topic.
         */
-       CommandTopic (InspIRCd* Instance) : Command(Instance,"TOPIC",0,1,false,2) { syntax = "<channel> [<topic>]"; }
+       CommandTopic (InspIRCd* Instance) : Command(Instance,NULL,"TOPIC",0,1,false,2) { syntax = "<channel> [<topic>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 110bc71768a13d24273876a06519e9c9194f1cfd..871d150fd3d5b55294d9e00401a08a0a5c942275 100644 (file)
@@ -29,7 +29,7 @@ class CommandTrace : public Command
  public:
        /** Constructor for trace.
         */
-       CommandTrace (InspIRCd* Instance) : Command(Instance,"TRACE","o",0) { syntax = "[<object>]"; }
+       CommandTrace (InspIRCd* Instance) : Command(Instance,NULL,"TRACE","o",0) { syntax = "[<object>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index e7e8523e2bdf67ba09b44c8ec212a21139d762d3..dd60bfd797c5494ce0d8c5be811d662f042cbf87 100644 (file)
@@ -29,7 +29,7 @@ class CommandUnloadmodule : public Command
  public:
        /** Constructor for unloadmodule.
         */
-       CommandUnloadmodule (InspIRCd* Instance) : Command(Instance,"UNLOADMODULE","o",1) { syntax = "<modulename>"; }
+       CommandUnloadmodule (InspIRCd* Instance) : Command(Instance,NULL,"UNLOADMODULE","o",1) { syntax = "<modulename>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 346730878de2e19c710e06054f0122377e0962ec..9bc28b912c8d58159b5f6af5fa0972c1884dc54b 100644 (file)
@@ -29,7 +29,7 @@ class CommandUser : public Command
  public:
        /** Constructor for user.
         */
-       CommandUser (InspIRCd* Instance) : Command(Instance,"USER",0,4,true,0) { syntax = "<username> <localhost> <remotehost> <GECOS>"; }
+       CommandUser (InspIRCd* Instance) : Command(Instance,NULL,"USER",0,4,true,0) { syntax = "<username> <localhost> <remotehost> <GECOS>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 65d1cc334a2bf581085d8d56de508736ddfc3cc6..1ba15f5a81661d8ac1914896059fda08f6e961f3 100644 (file)
@@ -29,7 +29,7 @@ class CommandUserhost : public Command
  public:
        /** Constructor for userhost.
         */
-       CommandUserhost (InspIRCd* Instance) : Command(Instance,"USERHOST",0,1) { syntax = "<nick>{,<nick>}"; }
+       CommandUserhost (InspIRCd* Instance) : Command(Instance,NULL,"USERHOST",0,1) { syntax = "<nick>{,<nick>}"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 559d7841b38c19249c8640a4baaf9bc5888adf3b..f093591a4952d193ba1fa70ee5bdbb30e45104ba 100644 (file)
@@ -29,7 +29,7 @@ class CommandVersion : public Command
  public:
        /** Constructor for version.
         */
-       CommandVersion (InspIRCd* Instance) : Command(Instance,"VERSION",0,0) { syntax = "[<servername>]"; }
+       CommandVersion (InspIRCd* Instance) : Command(Instance,NULL,"VERSION",0,0) { syntax = "[<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index b3b42fc0253f471d6f11e3758e97271db0b0a23e..34089cdaee2a0e5fc2ab3e93fa793f16620c21d3 100644 (file)
@@ -29,7 +29,7 @@ class CommandWallops : public Command
  public:
        /** Constructor for wallops.
         */
-       CommandWallops (InspIRCd* Instance) : Command(Instance,"WALLOPS","o",1,1) { syntax = "<any-text>"; }
+       CommandWallops (InspIRCd* Instance) : Command(Instance,NULL,"WALLOPS","o",1,1) { syntax = "<any-text>"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index a6afd425fc73a3c68b2c3d6f242a700637bf1296..65adc549c747df61c87a095299941dc76baae0b7 100644 (file)
@@ -43,7 +43,7 @@ class CommandWho : public Command
  public:
        /** Constructor for who.
         */
-       CommandWho (InspIRCd* Instance) : Command(Instance,"WHO", 0, 1, false, 2) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiaplf]"; }
+       CommandWho (InspIRCd* Instance) : Command(Instance,NULL,"WHO", 0, 1, false, 2) { syntax = "<server>|<nickname>|<channel>|<realname>|<host>|0 [ohurmMiaplf]"; }
        void SendWhoLine(User* user, const std::string &initial, Channel* ch, User* u, std::vector<std::string> &whoresults);
        /** Handle command.
         * @param parameters The parameters to the comamnd
index bf6658b7a56f80086bab4170c4f640f4328eb2cb..494095e07c4654650bfdc154f572ebe98a2d9ffa 100644 (file)
@@ -32,7 +32,7 @@ class CommandWhois : public Command
  public:
        /** Constructor for whois.
         */
-       CommandWhois (InspIRCd* Instance) : Command(Instance,"WHOIS",0,1,false,2) { syntax = "<nick>{,<nick>}"; }
+       CommandWhois (InspIRCd* Instance) : Command(Instance,NULL,"WHOIS",0,1,false,2) { syntax = "<nick>{,<nick>}"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index fdca7c9dc73e7e5536eca419c418378d97554d50..fa45ef1541c92f4091179f815ada365109d5183c 100644 (file)
@@ -29,7 +29,7 @@ class CommandZline : public Command
  public:
        /** Constructor for zline.
         */
-       CommandZline (InspIRCd* Instance) : Command(Instance,"ZLINE","o",1,3,false,0) { syntax = "<ipmask> [<duration> :<reason>]"; }
+       CommandZline (InspIRCd* Instance) : Command(Instance,NULL,"ZLINE","o",1,3,false,0) { syntax = "<ipmask> [<duration> :<reason>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index a543b7e3756ebc9e230af183d11d99b8c9248de5..315b38f4396e08af8b8e7fc30473fdcc6a67e587 100644 (file)
@@ -79,7 +79,10 @@ class CoreExport Command : public Extensible
  public:
        /** Command name
        */
-        std::string command;
+       std::string command;
+
+       /** Creator module, NULL for core commands */
+       Module* creator;
 
        /** User flags needed to execute the command or 0
         */
@@ -100,12 +103,8 @@ class CoreExport Command : public Extensible
        long double use_count;
 
        /** used by /stats m
-        */
-       long double total_bytes;
-
-       /** used for resource tracking between modules
         */
-       std::string source;
+       long double total_bytes;
 
        /** True if the command is disabled to non-opers
         */
@@ -140,22 +139,20 @@ class CoreExport Command : public Extensible
         * be allowed before the user is 'registered' (has sent USER,
         * NICK, optionally PASS, and been resolved).
         */
-       Command(InspIRCd* Instance, const std::string &cmd, const char *flags, int minpara, bool before_reg = false, int penalty = 1) :         ServerInstance(Instance), command(cmd), flags_needed(flags ? *flags : 0), min_params(minpara), max_params(0), disabled(false), works_before_reg(before_reg), Penalty(penalty)
+       Command(InspIRCd* Instance, Module* me, const std::string &cmd, const char *flags, int minpara, bool before_reg = false, int penalty = 1) :
+               ServerInstance(Instance), command(cmd), creator(me), flags_needed(flags ? *flags : 0),
+               min_params(minpara), max_params(0), disabled(false), works_before_reg(before_reg), Penalty(penalty)
        {
                use_count = 0;
                total_bytes = 0;
-               source = "<core>";
-               syntax = "";
-               translation.clear();
        }
 
-       Command(InspIRCd* Instance, const std::string &cmd, const char *flags, int minpara, int maxpara, bool before_reg = false, int penalty = 1) :    ServerInstance(Instance), command(cmd), flags_needed(flags ? *flags : 0), min_params(minpara), max_params(maxpara), disabled(false), works_before_reg(before_reg), Penalty(penalty)
+       Command(InspIRCd* Instance, Module* me, const std::string &cmd, const char *flags, int minpara, int maxpara, bool before_reg = false, int penalty = 1) :
+               ServerInstance(Instance), command(cmd), creator(me), flags_needed(flags ? *flags : 0),
+               min_params(minpara), max_params(maxpara), disabled(false), works_before_reg(before_reg), Penalty(penalty)
        {
                use_count = 0;
                total_bytes = 0;
-               source = "<core>";
-               syntax = "";
-               translation.clear();
        }
 
        /** Handle the command from a user.
index da202c2364c5f09e2a2703f36ef72d878a3bc50c..0f43d6db47ff9ee7c28c4f79175473437323a8f5 100644 (file)
@@ -150,6 +150,9 @@ class CoreExport ModeHandler : public classbase
        char prefixneeded;
 
  public:
+       /** Module that created this mode. NULL for core modes */
+       Module* creator;
+
        /**
         * The constructor for ModeHandler initalizes the mode handler.
         * The constructor of any class you derive from ModeHandler should
@@ -165,9 +168,12 @@ class CoreExport ModeHandler : public classbase
         * In the core, the only modes to implement prefixes are +ovh (ops, voice, halfop) which define the prefix characters @, % and +
         * and the rank values OP_VALUE, HALFOP_VALUE and VOICE_VALUE respectively. Any prefixes you define should have unique values proportional
         * to these three defaults or proportional to another mode in a module you depend on. See src/cmode_o.cpp as an example.
+        * @param prefixrequired The prefix required to change this mode
+        * @param translate The translation type for the argument(s) of this mode
         */
-       ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly,
-               char mprefix = 0, char prefixrequired = '%', TranslateType translate = TR_TEXT);
+       ModeHandler(InspIRCd* Instance, Module* me, char modeletter, int parameters_on, int parameters_off,
+               bool listmode, ModeType type, bool operonly, char mprefix = 0,
+               char prefixrequired = '%', TranslateType translate = TR_TEXT);
        /**
         * The default destructor does nothing
         */
@@ -321,8 +327,9 @@ class CoreExport ModeHandler : public classbase
 class CoreExport SimpleUserModeHandler : public ModeHandler
 {
  public:
-       SimpleUserModeHandler(InspIRCd* Instance, char modeletter);
-       virtual ~SimpleUserModeHandler();
+       SimpleUserModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
+               : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_USER, false) {}
+       virtual ~SimpleUserModeHandler() {}
        virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
 };
 
@@ -334,8 +341,9 @@ class CoreExport SimpleUserModeHandler : public ModeHandler
 class CoreExport SimpleChannelModeHandler : public ModeHandler
 {
  public:
-       SimpleChannelModeHandler(InspIRCd* Instance, char modeletter);
-       virtual ~SimpleChannelModeHandler();
+       SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
+               : ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_CHANNEL, false) {}
+       virtual ~SimpleChannelModeHandler() {}
        virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
 };
 
index 0a2c25710568235ea65fc90211f25c64ef0456fe..d6e534e07c65c11faf8c73f0ce4b10e89e5370fe 100644 (file)
@@ -124,7 +124,7 @@ class ListModeBase : public ModeHandler
        bool tidy;
        /** Config tag to check for max items per channel
         */
-       std::string configtag;
+       std::string configtag;
        /** Limits on a per-channel basis read from the tag
         * specified in ListModeBase::configtag
         */
@@ -140,8 +140,8 @@ class ListModeBase : public ModeHandler
         * @param autotidy Automatically tidy list entries on add
         * @param ctag Configuration tag to get limits from
         */
-       ListModeBase(InspIRCd* Instance, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag = "banlist")
-       : ModeHandler(Instance, modechar, 1, 1, true, MODETYPE_CHANNEL, false), listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy), configtag(ctag)
+       ListModeBase(InspIRCd* Instance, Module* Creator, char modechar, const std::string &eolstr, unsigned int lnum, unsigned int eolnum, bool autotidy, const std::string &ctag = "banlist")
+               : ModeHandler(Instance, Creator, modechar, 1, 1, true, MODETYPE_CHANNEL, false), listnumeric(lnum), endoflistnumeric(eolnum), endofliststring(eolstr), tidy(autotidy), configtag(ctag)
        {
                this->DoRehash();
                infokey = "listbase_mode_" + std::string(1, mode) + "_list";
index efc295e5e4d52adf20d139084dc201955c9482a0..e7478478a649e9c207cbaee71decafb4c26a9242 100644 (file)
@@ -161,7 +161,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, unsigned int
 
        if (n != cmdlist.end())
        {
-               if ((pcnt >= n->second->min_params) && (n->second->source != "<core>"))
+               if ((pcnt >= n->second->min_params) && (n->second->creator != NULL))
                {
                        if (IS_LOCAL(user) && n->second->flags_needed)
                        {
@@ -414,7 +414,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
        }
 }
 
-void CommandParser::RemoveCommands(const char* source)
+void CommandParser::RemoveCommands(Module* source)
 {
        Commandtable::iterator i,safei;
        for (i = cmdlist.begin(); i != cmdlist.end();)
@@ -441,10 +441,10 @@ void CommandParser::RemoveRFCCommands()
        delete reload;
 }
 
-void CommandParser::RemoveCommand(Commandtable::iterator safei, const char* source)
+void CommandParser::RemoveCommand(Commandtable::iterator safei, Module* source)
 {
        Command* x = safei->second;
-       if (x->source == std::string(source))
+       if (x->creator == source)
        {
                cmdlist.erase(safei);
        }
index 8f46824e8dad825301fd0af44bd4a8395b8ede63..2683f06190024d5503087e71ad34b99ac06a02f8 100644 (file)
@@ -25,10 +25,11 @@ CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
 {
        for (Commandtable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
        {
+               Module* src = i->second->creator;
                user->WriteNumeric(RPL_COMMANDS, "%s :%s %s %d %d",
                                user->nick.c_str(),
                                i->second->command.c_str(),
-                               i->second->source.c_str(),
+                               src ? src->ModuleSourceFile.c_str() : "<core>",
                                i->second->min_params,
                                i->second->Penalty);
        }
index e5542d16e19f82762ce8f7c1640970b5b741e885..1109b4d8ba63f6dfc88310781b45ce05d623a191 100644 (file)
@@ -21,7 +21,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance)
        return new CommandWhowas(Instance);
 }
 
-CommandWhowas::CommandWhowas(InspIRCd* Instance) : Command(Instance, "WHOWAS", 0, 1, false, 2)
+CommandWhowas::CommandWhowas(InspIRCd* Instance) : Command(Instance, NULL, "WHOWAS", 0, 1, false, 2)
 {
        syntax = "<nick>{,<nick>}";
        timer = new WhoWasMaintainTimer(Instance, 3600);
index cbd58021cb27d73fe57d2ff4aa68b7d650b5adbb..e31855e7733eeed534da1b64d5fc56b4ed00eae3 100644 (file)
@@ -49,8 +49,8 @@
 /* +s (server notice masks) */
 #include "modes/umode_s.h"
 
-ModeHandler::ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, char mprefix, char prefixrequired, TranslateType translate)
-       : ServerInstance(Instance), mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), m_paramtype(translate), oper(operonly), prefix(mprefix), count(0), prefixneeded(prefixrequired)
+ModeHandler::ModeHandler(InspIRCd* Instance, Module* Creator, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, char mprefix, char prefixrequired, TranslateType translate)
+       : ServerInstance(Instance), mode(modeletter), n_params_on(parameters_on), n_params_off(parameters_off), list(listmode), m_type(type), m_paramtype(translate), oper(operonly), prefix(mprefix), count(0), prefixneeded(prefixrequired), creator(Creator)
 {
 }
 
@@ -160,22 +160,6 @@ bool ModeHandler::CheckTimeStamp(std::string& theirs, const std::string& ours, C
        return (theirs < ours);
 }
 
-SimpleUserModeHandler::SimpleUserModeHandler(InspIRCd* Instance, char modeletter) : ModeHandler(Instance, modeletter, 0, 0, false, MODETYPE_USER, false)
-{
-}
-
-SimpleUserModeHandler::~SimpleUserModeHandler()
-{
-}
-
-SimpleChannelModeHandler::~SimpleChannelModeHandler()
-{
-}
-
-SimpleChannelModeHandler::SimpleChannelModeHandler(InspIRCd* Instance, char modeletter) : ModeHandler(Instance, modeletter, 0, 0, false, MODETYPE_CHANNEL, false)
-{
-}
-
 ModeAction SimpleUserModeHandler::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
 {
        if (adding)
index dad47a67bce878be86fd7fd4685834fa4f772a90..595bdb99e9458694792a1ef6f60b4712ef8f5ab4 100644 (file)
@@ -25,7 +25,7 @@
 #include "hashcomp.h"
 #include "modes/cmode_b.h"
 
-ModeChannelBan::ModeChannelBan(InspIRCd* Instance) : ModeHandler(Instance, 'b', 1, 1, true, MODETYPE_CHANNEL, false)
+ModeChannelBan::ModeChannelBan(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'b', 1, 1, true, MODETYPE_CHANNEL, false)
 {
 }
 
index 9e706c325374bac2f9399e687482fe0478463d47..24eacdb247a9d85caf12198bd5eb7e04483f7258 100644 (file)
@@ -19,7 +19,7 @@
 #include "modules.h"
 #include "modes/cmode_h.h"
 
-ModeChannelHalfOp::ModeChannelHalfOp(InspIRCd* Instance) : ModeHandler(Instance, 'h', 1, 1, true, MODETYPE_CHANNEL, false, '%', '@', TR_NICK)
+ModeChannelHalfOp::ModeChannelHalfOp(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'h', 1, 1, true, MODETYPE_CHANNEL, false, '%', '@', TR_NICK)
 {
 }
 
index ad4b5e8d8012d2e82bd5b727fe748c3e05c8e5b5..60183b001186065122fa5ffd9024371ab8342137 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_i.h"
 
-ModeChannelInviteOnly::ModeChannelInviteOnly(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'i')
+ModeChannelInviteOnly::ModeChannelInviteOnly(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'i')
 {
 }
 
index b270966da42565b8e0558000753c39640998bbc7..4ffc24686cb6bd7094147ef0ddfd9129308a4967 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_k.h"
 
-ModeChannelKey::ModeChannelKey(InspIRCd* Instance) : ModeHandler(Instance, 'k', 1, 1, false, MODETYPE_CHANNEL, false)
+ModeChannelKey::ModeChannelKey(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'k', 1, 1, false, MODETYPE_CHANNEL, false)
 {
 }
 
index d60c9b3a79c35552f7864e87ec8bd78d78653f88..e0293de7297e83e95db65ce3f70c68f69ef6a0b2 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_l.h"
 
-ModeChannelLimit::ModeChannelLimit(InspIRCd* Instance) : ModeHandler(Instance, 'l', 1, 0, false, MODETYPE_CHANNEL, false)
+ModeChannelLimit::ModeChannelLimit(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'l', 1, 0, false, MODETYPE_CHANNEL, false)
 {
 }
 
index 2f1b1df310d3b52d5255fde3d79d5f9635e72b19..1e40e9a168d4e6eb8042ac28ea5155cc7f1b39f5 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_m.h"
 
-ModeChannelModerated::ModeChannelModerated(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'm')
+ModeChannelModerated::ModeChannelModerated(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'm')
 {
 }
 
index 5e1f68c60cc10999999bd74b4728b4b99f028028..bdc3521a5b89d1b4a96d13fe0d877dbdac58313c 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_n.h"
 
-ModeChannelNoExternal::ModeChannelNoExternal(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'n')
+ModeChannelNoExternal::ModeChannelNoExternal(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'n')
 {
 }
 
index e39591f63566a23342d01d71dbe3463ad7399d6e..cadd7ee26cee0e65f9813eca39fec2d863fdee5c 100644 (file)
@@ -19,7 +19,7 @@
 #include "modules.h"
 #include "modes/cmode_o.h"
 
-ModeChannelOp::ModeChannelOp(InspIRCd* Instance) : ModeHandler(Instance, 'o', 1, 1, true, MODETYPE_CHANNEL, false, '@', '@', TR_NICK)
+ModeChannelOp::ModeChannelOp(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'o', 1, 1, true, MODETYPE_CHANNEL, false, '@', '@', TR_NICK)
 {
 }
 
index 9c8e33107c582eae2711eef2082f24151ca7d990..d5f52eb78cf31a1e6091f072916d052d8b045dd8 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_p.h"
 
-ModeChannelPrivate::ModeChannelPrivate(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'p')
+ModeChannelPrivate::ModeChannelPrivate(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 'p')
 {
 }
 
index b7bd2543021742921725b4cbe7d16a913f006045..d5ec5bbed25592dbac25fb1666717e7c24c37f21 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_s.h"
 
-ModeChannelSecret::ModeChannelSecret(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 's')
+ModeChannelSecret::ModeChannelSecret(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, NULL, 's')
 {
 }
 
index 2a2a61c4e3417bb5a7efd6caea764100d00dd5d4..ca6a4a105088d68adc4377d7a5188c2c337c8672 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/cmode_t.h"
 
-ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(Instance, 't', 0, 0, false, MODETYPE_CHANNEL, false)
+ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(Instance, NULL, 't', 0, 0, false, MODETYPE_CHANNEL, false)
 {
 }
 
index 053475d3d3c89dd67e720a4867f90156ac39bac4..cba8e7fd034e431e9c4225b5b84d7b5e3e98e02c 100644 (file)
@@ -20,7 +20,7 @@
 #include "modules.h"
 #include "modes/cmode_v.h"
 
-ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, 'v', 1, 1, true, MODETYPE_CHANNEL, false, '+', '%', TR_NICK)
+ModeChannelVoice::ModeChannelVoice(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'v', 1, 1, true, MODETYPE_CHANNEL, false, '+', '%', TR_NICK)
 {
 }
 
index ea8f1ce42208eb3d7a841ccc7305a9e9747962f1..caac9ff37783ac0818850502c8863e229f912538 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_i.h"
 
-ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'i')
+ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : SimpleUserModeHandler(Instance, NULL, 'i')
 {
 }
 
index df69a841966366b33511ff3edb4ba5353931453a..6848f6e174be502aa01cea9067feb61f246aa58c 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_o.h"
 
-ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, 'o', 0, 0, false, MODETYPE_USER, true)
+ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, NULL, 'o', 0, 0, false, MODETYPE_USER, true)
 {
 }
 
index 0c1c30948bbf2533a935cd073e5dbcde75692fa2..8bac7cd533e81dec076f3ce88e94d9c20ba62583 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_s.h"
 
-ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, 's', 1, 0, false, MODETYPE_USER, true)
+ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, NULL, 's', 1, 0, false, MODETYPE_USER, true)
 {
 }
 
index a78e252a30986dd3dce4d70dfe479199dd7a92e2..5990fd2a0d4acf84f0f406ab78338fcd82bfcd86 100644 (file)
@@ -17,7 +17,7 @@
 #include "users.h"
 #include "modes/umode_w.h"
 
-ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'w')
+ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : SimpleUserModeHandler(Instance, NULL, 'w')
 {
 }
 
index 5b2cc8ee4a2ac937ec1ba7585c2025b02faf79d3..ed85bedee778fdef18059b9b211c397d59afd9a6 100644 (file)
@@ -555,7 +555,7 @@ bool ModuleManager::Unload(const char* filename)
 
                this->DetachAll(modfind->second.second);
 
-               Instance->Parser->RemoveCommands(filename);
+               Instance->Parser->RemoveCommands(modfind->second.second);
 
                delete modfind->second.second;
                delete modfind->second.first;
index 7c5f7ee493d3246392d1e682ea39cf2cc7b42390..f5133a1dc7a9a332cf12d42d5aba890fc7e231ce 100644 (file)
@@ -47,11 +47,9 @@ public:
 
 class CommandStartTLS : public Command
 {
-       Module* Caller;
  public:
-       CommandStartTLS (InspIRCd* Instance, Module* mod) : Command(Instance,"STARTTLS", 0, 0, true), Caller(mod)
+       CommandStartTLS (InspIRCd* Instance, Module* mod) : Command(Instance, mod, "STARTTLS", 0, 0, true)
        {
-               this->source = "m_ssl_gnutls.so";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -69,8 +67,8 @@ class CommandStartTLS : public Command
                        if (!user->GetIOHook())
                        {
                                user->WriteNumeric(670, "%s :STARTTLS successful, go ahead with TLS handshake", user->nick.c_str());
-                               user->AddIOHook(Caller);
-                               Caller->OnRawSocketAccept(user->GetFd(), NULL, NULL);
+                               user->AddIOHook(creator);
+                               creator->OnRawSocketAccept(user->GetFd(), NULL, NULL);
                        }
                        else
                                user->WriteNumeric(691, "%s :STARTTLS failure", user->nick.c_str());
index e177f8ee62202a59810c8a9bfb2677c37ab917b6..ce4d73098e331b0831d0846a7a8090b35626063c 100644 (file)
@@ -18,7 +18,7 @@
 class AllowInvite : public SimpleChannelModeHandler
 {
  public:
-       AllowInvite(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'A') { }
+       AllowInvite(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'A') { }
 };
 
 class ModuleAllowInvite : public Module
@@ -26,7 +26,7 @@ class ModuleAllowInvite : public Module
        AllowInvite ni;
  public:
 
-       ModuleAllowInvite(InspIRCd* Me) : Module(Me), ni(Me)
+       ModuleAllowInvite(InspIRCd* Me) : Module(Me), ni(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&ni))
                        throw ModuleException("Could not add new modes!");
index 79a94c2b6f8114bb9697947092b2cd13c92ff2ce..7121ac4c795a3a071a054c3f19b9140e62a585a1 100644 (file)
@@ -18,9 +18,8 @@
 class CommandAlltime : public Command
 {
  public:
-       CommandAlltime(InspIRCd *Instance) : Command(Instance, "ALLTIME", "o", 0)
+       CommandAlltime(InspIRCd *Instance, Module* Creator) : Command(Instance, Creator, "ALLTIME", "o", 0)
        {
-               this->source = "m_alltime.so";
                syntax.clear();
                translation.push_back(TR_END);
        }
@@ -53,7 +52,7 @@ class Modulealltime : public Module
        CommandAlltime mycommand;
  public:
        Modulealltime(InspIRCd *Me)
-               : Module(Me), mycommand(Me)
+               : Module(Me), mycommand(Me, this)
        {
                ServerInstance->AddCommand(&mycommand);
        }
index 8da062593f99ed2f2f157bdfab7866a72ee0d2d9..ae5fba018d358a965c42a96d605f1fdb7a2658fe 100644 (file)
@@ -18,7 +18,7 @@
 class AuditoriumMode : public ModeHandler
 {
  public:
-       AuditoriumMode(InspIRCd* Instance) : ModeHandler(Instance, 'u', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') { }
+       AuditoriumMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'u', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -42,7 +42,7 @@ class ModuleAuditorium : public Module
        bool OperOverride;
  public:
        ModuleAuditorium(InspIRCd* Me)
-               : Module(Me), aum(Me)
+               : Module(Me), aum(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&aum))
                        throw ModuleException("Could not add new modes!");
index 93267e03c3420dbc11c4217114792e4bf31e3f13..55a5da83fbabbbab688417ec23840e1940992abc 100644 (file)
@@ -31,7 +31,7 @@
 class BanException : public ListModeBase
 {
  public:
-       BanException(InspIRCd* Instance) : ListModeBase(Instance, 'e', "End of Channel Exception List", 348, 349, true) { }
+       BanException(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'e', "End of Channel Exception List", 348, 349, true) { }
 };
 
 
@@ -40,7 +40,7 @@ class ModuleBanException : public Module
        BanException be;
 
 public:
-       ModuleBanException(InspIRCd* Me) : Module(Me), be(Me)
+       ModuleBanException(InspIRCd* Me) : Module(Me), be(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&be))
                        throw ModuleException("Could not add new modes!");
index bec69e60840964484dd30000a62d4ecec0ac31fe..8bbdc1edc5166d8646a7715c1c8faf554e0b772f 100644 (file)
@@ -38,8 +38,7 @@ typedef std::deque<std::string> StringDeque;
 class BanRedirect : public ModeWatcher
 {
  public:
-       BanRedirect(InspIRCd* Instance)
-       : ModeWatcher(Instance, 'b', MODETYPE_CHANNEL)
+       BanRedirect(InspIRCd* Instance) : ModeWatcher(Instance, 'b', MODETYPE_CHANNEL)
        {
        }
 
index 8b0c73ce3707f243524d9d45ba25da2969ab746e..6ce1cecc5445d7e8cfb90acadd2adce0e3678dae 100644 (file)
@@ -21,7 +21,7 @@
 class BlockCaps : public SimpleChannelModeHandler
 {
  public:
-       BlockCaps(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'B') { }
+       BlockCaps(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'B') { }
 };
 
 class ModuleBlockCAPS : public Module
@@ -32,7 +32,7 @@ class ModuleBlockCAPS : public Module
        char capsmap[256];
 public:
 
-       ModuleBlockCAPS(InspIRCd* Me) : Module(Me), bc(Me)
+       ModuleBlockCAPS(InspIRCd* Me) : Module(Me), bc(Me, this)
        {
                OnRehash(NULL);
                if (!ServerInstance->Modes->AddMode(&bc))
index 020627d01a280f5900f4a7441127faabf1741e68..982d225c3eb74e01cd55bf76b135a96345f1ea1a 100644 (file)
@@ -20,7 +20,7 @@
 class BlockColor : public SimpleChannelModeHandler
 {
  public:
-       BlockColor(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'c') { }
+       BlockColor(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'c') { }
 };
 
 class ModuleBlockColour : public Module
@@ -29,7 +29,7 @@ class ModuleBlockColour : public Module
        BlockColor bc;
  public:
 
-       ModuleBlockColour(InspIRCd* Me) : Module(Me), bc(Me)
+       ModuleBlockColour(InspIRCd* Me) : Module(Me), bc(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&bc))
                        throw ModuleException("Could not add new modes!");
index 01bc4635798e7091340ad8f3b1ca58c9f473b336..9ba154c151caeae07033d86c28f0a545d922394b 100644 (file)
@@ -20,7 +20,7 @@
 class BotMode : public SimpleUserModeHandler
 {
  public:
-       BotMode(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'B') { }
+       BotMode(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'B') { }
 };
 
 class ModuleBotMode : public Module
@@ -28,7 +28,7 @@ class ModuleBotMode : public Module
        BotMode bm;
  public:
        ModuleBotMode(InspIRCd* Me)
-               : Module(Me), bm(Me)
+               : Module(Me), bm(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&bm))
                        throw ModuleException("Could not add new modes!");
index 29ba7fd6022f2c113a1e7365519f35df5012115f..f275c0a88af7e6efcd9d601ecd156ea5e9513b59 100644 (file)
@@ -127,17 +127,15 @@ void RemoveData(User* who)
 class User_g : public SimpleUserModeHandler
 {
 public:
-       User_g(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'g') { }
+       User_g(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'g') { }
 };
 
 class CommandAccept : public Command
 {
-private:
-       unsigned int& maxaccepts;
 public:
-       CommandAccept(InspIRCd* Instance, unsigned int& max) : Command(Instance, "ACCEPT", 0, 1), maxaccepts(max)
+       unsigned int maxaccepts;
+       CommandAccept(InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "ACCEPT", 0, 1)
        {
-               source = "m_callerid.so";
                syntax = "{[+|-]<nicks>}|*}";
                TRANSLATE2(TR_CUSTOM, TR_END);
        }
@@ -311,7 +309,6 @@ private:
        User_g myumode;
 
        // Configuration variables:
-       unsigned int maxaccepts; // Maximum ACCEPT entries.
        bool operoverride; // Operators can override callerid.
        bool tracknick; // Allow ACCEPT entries to update with nick changes.
        unsigned int notify_cooldown; // Seconds between notifications.
@@ -342,7 +339,7 @@ private:
        }
 
 public:
-       ModuleCallerID(InspIRCd* Me) : Module(Me), mycommand(Me, maxaccepts), myumode(Me)
+       ModuleCallerID(InspIRCd* Me) : Module(Me), mycommand(Me, this), myumode(Me, this)
        {
                OnRehash(NULL);
 
@@ -466,7 +463,7 @@ public:
        virtual void OnRehash(User* user)
        {
                ConfigReader Conf(ServerInstance);
-               maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true);
+               mycommand.maxaccepts = Conf.ReadInteger("callerid", "maxaccepts", "16", 0, true);
                operoverride = Conf.ReadFlag("callerid", "operoverride", "0", 0);
                tracknick = Conf.ReadFlag("callerid", "tracknick", "0", 0);
                notify_cooldown = Conf.ReadInteger("callerid", "cooldown", "60", 0, true);
index 2e9a24811cbdd152c31a22bc83bf9c805c62de99..2b700a5ae013d0262d82a5554610576451384be9 100644 (file)
@@ -34,11 +34,9 @@ CAP END
  */
 class CommandCAP : public Command
 {
-       Module* Creator;
  public:
-       CommandCAP (InspIRCd* Instance, Module* mod) : Command(Instance,"CAP", 0, 1, true), Creator(mod)
+       CommandCAP (InspIRCd* Instance, Module* mod) : Command(Instance, mod, "CAP", 0, 1, true)
        {
-               this->source = "m_cap.so";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -51,7 +49,7 @@ class CommandCAP : public Command
 
                        Data.type = subcommand;
                        Data.user = user;
-                       Data.creator = this->Creator;
+                       Data.creator = this->creator;
 
                        if (parameters.size() < 2)
                                return CMD_FAILURE;
@@ -67,7 +65,7 @@ class CommandCAP : public Command
                        }
 
                        user->Extend("CAP_REGHOLD");
-                       Event event((char*) &Data, (Module*)this->Creator, "cap_req");
+                       Event event((char*) &Data, this->creator, "cap_req");
                        event.Send(this->ServerInstance);
 
                        if (Data.ack.size() > 0)
@@ -92,10 +90,10 @@ class CommandCAP : public Command
 
                        Data.type = subcommand;
                        Data.user = user;
-                       Data.creator = this->Creator;
+                       Data.creator = this->creator;
 
                        user->Extend("CAP_REGHOLD");
-                       Event event((char*) &Data, (Module*)this->Creator, subcommand == "LS" ? "cap_ls" : "cap_list");
+                       Event event((char*) &Data, this->creator, subcommand == "LS" ? "cap_ls" : "cap_list");
                        event.Send(this->ServerInstance);
 
                        std::string Result;
@@ -112,10 +110,10 @@ class CommandCAP : public Command
 
                        Data.type = subcommand;
                        Data.user = user;
-                       Data.creator = this->Creator;
+                       Data.creator = this->creator;
 
                        user->Extend("CAP_REGHOLD");
-                       Event event((char*) &Data, (Module*)this->Creator, "cap_clear");
+                       Event event((char*) &Data, this->creator, "cap_clear");
                        event.Send(this->ServerInstance);
 
                        std::string Result = irc::stringjoiner(" ", Data.ack, 0, Data.ack.size() - 1).GetJoined();
index a815cf35f602c8266b83ad91b26ebfb0e2af4cec..bf4fa4e6de64f9cba1cd6af171d41522c03c2781 100644 (file)
@@ -84,9 +84,8 @@ class CBanFactory : public XLineFactory
 class CommandCBan : public Command
 {
  public:
-       CommandCBan(InspIRCd* Me) : Command(Me, "CBAN", "o", 1, 3)
+       CommandCBan(InspIRCd* Me, Module* Creator) : Command(Me, Creator, "CBAN", "o", 1, 3)
        {
-               this->source = "m_cban.so";
                this->syntax = "<channel> [<duration> :<reason>]";
                TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END);
        }
@@ -162,7 +161,7 @@ class ModuleCBan : public Module
        CBanFactory f;
 
  public:
-       ModuleCBan(InspIRCd* Me) : Module(Me), mycommand(Me), f(Me)
+       ModuleCBan(InspIRCd* Me) : Module(Me), mycommand(Me, this), f(Me)
        {
                ServerInstance->XLines->RegisterFactory(&f);
 
index 9c68be7fdcb23a62771d0d9deb7377fbe58ec063..13527f64a90fc70d12833b0248b217d3b571d6f8 100644 (file)
@@ -26,7 +26,7 @@ typedef std::map<irc::string,irc::string> censor_t;
 class CensorUser : public SimpleUserModeHandler
 {
  public:
-       CensorUser(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'G') { }
+       CensorUser(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'G') { }
 };
 
 /** Handles channel mode +G
@@ -34,7 +34,7 @@ class CensorUser : public SimpleUserModeHandler
 class CensorChannel : public SimpleChannelModeHandler
 {
  public:
-       CensorChannel(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'G') { }
+       CensorChannel(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'G') { }
 };
 
 class ModuleCensor : public Module
@@ -45,7 +45,7 @@ class ModuleCensor : public Module
 
  public:
        ModuleCensor(InspIRCd* Me)
-               : Module(Me), cu(Me), cc(Me)
+               : Module(Me), cu(Me, this), cc(Me, this)
        {
                /* Read the configuration file on startup.
                 */
index 3e00f498d9ed2dd621a853647dd3974706636580..a406ad65806ff2d8c6cac3a51fdce590c2ec7337 100644 (file)
@@ -56,9 +56,9 @@ class CommandWebirc : public Command
                bool notify;
        public:
                CGIHostlist Hosts;
-               CommandWebirc(InspIRCd* Instance, bool bnotify) : Command(Instance, "WEBIRC", 0, 4, true), notify(bnotify)
+               CommandWebirc(InspIRCd* Instance, Module* Creator, bool bnotify)
+                       : Command(Instance, Creator, "WEBIRC", 0, 4, true), notify(bnotify)
                {
-                       this->source = "m_cgiirc.so";
                        this->syntax = "password client hostname ip";
                }
                CmdResult Handle(const std::vector<std::string> &parameters, User *user)
@@ -138,7 +138,7 @@ class ModuleCgiIRC : public Module
        CommandWebirc cmd;
        bool NotifyOpers;
 public:
-       ModuleCgiIRC(InspIRCd* Me) : Module(Me), cmd(Me, NotifyOpers)
+       ModuleCgiIRC(InspIRCd* Me) : Module(Me), cmd(Me, this, NotifyOpers)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
index d9808642102063013e787b2245e827d343e033ec..977bab4cbb58053819fc083f13c8f0fd4b02c019 100644 (file)
@@ -25,7 +25,7 @@
 class ChanFilter : public ListModeBase
 {
  public:
-       ChanFilter(InspIRCd* Instance) : ListModeBase(Instance, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { }
+       ChanFilter(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { }
 
        virtual bool ValidateParam(User* user, Channel* chan, std::string &word)
        {
@@ -63,7 +63,7 @@ class ModuleChanFilter : public Module
  public:
 
        ModuleChanFilter(InspIRCd* Me)
-               : Module(Me), cf(Me)
+               : Module(Me), cf(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&cf))
                        throw ModuleException("Could not add new modes!");
index e24e64a3e90451756dce75f8447c46b7944580ff..6301f56cb2bb6362e073fe43c4895a45eac536c2 100644 (file)
@@ -156,8 +156,8 @@ class FounderProtectBase
 class ChanFounder : public ModeHandler, public FounderProtectBase
 {
  public:
-       ChanFounder(InspIRCd* Instance, char my_prefix, bool &depriv_self, bool &depriv_others)
-               : ModeHandler(Instance, 'q', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK),
+       ChanFounder(InspIRCd* Instance, Module* Creator, char my_prefix, bool &depriv_self, bool &depriv_others)
+               : ModeHandler(Instance, Creator, 'q', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK),
                  FounderProtectBase(Instance, "cm_founder_", "founder", 386, 387, depriv_self, depriv_others) { }
 
        unsigned int GetPrefixRank()
@@ -232,8 +232,8 @@ class ChanFounder : public ModeHandler, public FounderProtectBase
 class ChanProtect : public ModeHandler, public FounderProtectBase
 {
  public:
-       ChanProtect(InspIRCd* Instance, char my_prefix, bool &depriv_self, bool &depriv_others)
-               : ModeHandler(Instance, 'a', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK),
+       ChanProtect(InspIRCd* Instance, Module* Creator, char my_prefix, bool &depriv_self, bool &depriv_others)
+               : ModeHandler(Instance, Creator, 'a', 1, 1, true, MODETYPE_CHANNEL, false, my_prefix, 0, TR_NICK),
                  FounderProtectBase(Instance,"cm_protect_","protected user", 388, 389, depriv_self, depriv_others) { }
 
        unsigned int GetPrefixRank()
@@ -328,8 +328,8 @@ class ModuleChanProtect : public Module
 
                /* Initialise module variables */
 
-               cp = new ChanProtect(ServerInstance, APrefix, DeprivSelf, DeprivOthers);
-               cf = new ChanFounder(ServerInstance, QPrefix, DeprivSelf, DeprivOthers);
+               cp = new ChanProtect(ServerInstance, this, APrefix, DeprivSelf, DeprivOthers);
+               cf = new ChanFounder(ServerInstance, this, QPrefix, DeprivSelf, DeprivOthers);
 
                if (!ServerInstance->Modes->AddMode(cp) || !ServerInstance->Modes->AddMode(cf))
                {
index 6ba578194d20e861f96ae7af0a47573adf27fb44..f8e770337794b60065b2e8f5b52b1936c6ef0e5a 100644 (file)
  */
 class CommandCheck : public Command
 {
-       Module* Parent;
  public:
        std::set<std::string> meta_seen;
-       CommandCheck (InspIRCd* Instance, Module* parent) : Command(Instance,"CHECK", "o", 1), Parent(parent)
+       CommandCheck (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"CHECK", "o", 1)
        {
-               this->source = "m_check.so";
                syntax = "<nickname>|<ip>|<hostmask>|<channel>";
        }
 
@@ -114,7 +112,7 @@ class CommandCheck : public Command
 
                        ServerInstance->DumpText(user,checkstr + " onchans ", dump);
 
-                       FOREACH_MOD_I(ServerInstance,I_OnSyncUser,OnSyncUser(targuser,Parent,(void*)user));
+                       FOREACH_MOD_I(ServerInstance,I_OnSyncUser,OnSyncUser(targuser,creator,(void*)user));
                        dumpExtra(user, checkstr, targuser);
                }
                else if (targchan)
@@ -148,7 +146,7 @@ class CommandCheck : public Command
                                user->WriteServ(checkstr + " member " + tmpbuf);
                        }
 
-                       FOREACH_MOD_I(ServerInstance,I_OnSyncChannel,OnSyncChannel(targchan,Parent,(void*)user));
+                       FOREACH_MOD_I(ServerInstance,I_OnSyncChannel,OnSyncChannel(targchan,creator,(void*)user));
                        dumpExtra(user, checkstr, targchan);
                }
                else
index cfd8f60352936c954db7a50e05e0dc9364a0ec03..a8cad8d43c47a91dfa7b19f1bdfb4ee4b03496c5 100644 (file)
@@ -22,9 +22,8 @@ class CommandChghost : public Command
  private:
        char* hostmap;
  public:
-       CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST","o",2), hostmap(hmap)
+       CommandChghost (InspIRCd* Instance, Module* Creator, char* hmap) : Command(Instance,Creator,"CHGHOST","o",2), hostmap(hmap)
        {
-               this->source = "m_chghost.so";
                syntax = "<nick> <newhost>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -85,7 +84,7 @@ class ModuleChgHost : public Module
        char hostmap[256];
  public:
        ModuleChgHost(InspIRCd* Me)
-               : Module(Me), cmd(Me, hostmap)
+               : Module(Me), cmd(Me, this, hostmap)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
index 9dc8cbd50c22406e7c67860e46bc03b22384d803..58a06cbd8366104ed05439dc9b43e2d4ead3bdd8 100644 (file)
@@ -20,9 +20,8 @@
 class CommandChgident : public Command
 {
  public:
-       CommandChgident (InspIRCd* Instance) : Command(Instance,"CHGIDENT", "o", 2)
+       CommandChgident (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CHGIDENT", "o", 2)
        {
-               this->source = "m_chgident.so";
                syntax = "<nick> <newident>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -71,7 +70,7 @@ class ModuleChgIdent : public Module
        CommandChgident cmd;
 
 public:
-       ModuleChgIdent(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleChgIdent(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 704e142bcb9f84e1d2197ee162f2ed88e1069ba8..23c870294cf00153cc8e589ce2c662289530c3d6 100644 (file)
@@ -20,9 +20,8 @@
 class CommandChgname : public Command
 {
  public:
-       CommandChgname (InspIRCd* Instance) : Command(Instance,"CHGNAME", "o", 2, 2)
+       CommandChgname (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CHGNAME", "o", 2, 2)
        {
-               this->source = "m_chgname.so";
                syntax = "<nick> <newname>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -66,7 +65,7 @@ class ModuleChgName : public Module
        CommandChgname cmd;
 
 public:
-       ModuleChgName(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleChgName(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 458d833dfab28258c9f992d802765860a6166089..77316a346b89a44b935d0d868f54a4bd58c60cc9 100644 (file)
@@ -28,7 +28,6 @@ class CloakUser : public ModeHandler
        unsigned int key3;
        unsigned int key4;
        bool ipalways;
-       Module* Sender;
        Module* HashProvider;
        const char *xtab[4];
 
@@ -63,7 +62,8 @@ class CloakUser : public ModeHandler
                        return host.substr(splitdot);
        }
 
-       CloakUser(InspIRCd* Instance, Module* source, Module* Hash) : ModeHandler(Instance, 'x', 0, 0, false, MODETYPE_USER, false), Sender(source), HashProvider(Hash)
+       CloakUser(InspIRCd* Instance, Module* source, Module* Hash) 
+               : ModeHandler(Instance, source, 'x', 0, 0, false, MODETYPE_USER, false), HashProvider(Hash)
        {
        }
 
@@ -100,7 +100,7 @@ class CloakUser : public ModeHandler
                                if (!dest->GetExt("cloaked_host", cloak))
                                {
                                        /* Force creation of missing cloak */
-                                       Sender->OnUserConnect(dest);
+                                       creator->OnUserConnect(dest);
                                }
                                if (dest->GetExt("cloaked_host", cloak))
                                {
@@ -145,14 +145,14 @@ class CloakUser : public ModeHandler
                octet[1] = octet[0] + "." + octet[1];
 
                /* Reset the Hash module and send it our IV */
-               HashResetRequest(Sender, HashProvider).Send();
-               HashKeyRequest(Sender, HashProvider, iv).Send();
+               HashResetRequest(creator, HashProvider).Send();
+               HashKeyRequest(creator, HashProvider, iv).Send();
 
                /* Send the Hash module a different hex table for each octet group's Hash sum */
                for (int k = 0; k < 4; k++)
                {
-                       HashHexRequest(Sender, HashProvider, xtab[(iv[k]+i[k]) % 4]).Send();
-                       ra[k] = std::string(HashSumRequest(Sender, HashProvider, octet[k]).Send()).substr(0,6);
+                       HashHexRequest(creator, HashProvider, xtab[(iv[k]+i[k]) % 4]).Send();
+                       ra[k] = std::string(HashSumRequest(creator, HashProvider, octet[k]).Send()).substr(0,6);
                }
                /* Stick them all together */
                return std::string().append(ra[0]).append(".").append(ra[1]).append(".").append(ra[2]).append(".").append(ra[3]);
@@ -166,8 +166,8 @@ class CloakUser : public ModeHandler
                int rounds = 0;
 
                /* Reset the Hash module and send it our IV */
-               HashResetRequest(Sender, HashProvider).Send();
-               HashKeyRequest(Sender, HashProvider, iv).Send();
+               HashResetRequest(creator, HashProvider).Send();
+               HashKeyRequest(creator, HashProvider, iv).Send();
 
                for (const char* input = ip; *input; input++)
                {
@@ -175,8 +175,8 @@ class CloakUser : public ModeHandler
                        if (item.length() > 7)
                        {
                                /* Send the Hash module a different hex table for each octet group's Hash sum */
-                               HashHexRequest(Sender, HashProvider, xtab[(key1+rounds) % 4]).Send();
-                               hashies.push_back(std::string(HashSumRequest(Sender, HashProvider, item).Send()).substr(0,8));
+                               HashHexRequest(creator, HashProvider, xtab[(key1+rounds) % 4]).Send();
+                               hashies.push_back(std::string(HashSumRequest(creator, HashProvider, item).Send()).substr(0,8));
                                item.clear();
                        }
                        rounds++;
@@ -184,8 +184,8 @@ class CloakUser : public ModeHandler
                if (!item.empty())
                {
                        /* Send the Hash module a different hex table for each octet group's Hash sum */
-                       HashHexRequest(Sender, HashProvider, xtab[(key1+rounds) % 4]).Send();
-                       hashies.push_back(std::string(HashSumRequest(Sender, HashProvider, item).Send()).substr(0,8));
+                       HashHexRequest(creator, HashProvider, xtab[(key1+rounds) % 4]).Send();
+                       hashies.push_back(std::string(HashSumRequest(creator, HashProvider, item).Send()).substr(0,8));
                        item.clear();
                }
                /* Stick them all together */
index 58ecff17d22ab6b547d934d2622dfd2ac2e351f3..8c3429d9babbdec42e4446cc84826a8f7b00bb89 100644 (file)
@@ -20,9 +20,8 @@
 class CommandClones : public Command
 {
  public:
-       CommandClones (InspIRCd* Instance) : Command(Instance,"CLONES", "o", 1)
+       CommandClones (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CLONES", "o", 1)
        {
-               this->source = "m_clones.so";
                syntax = "<limit>";
        }
 
@@ -62,7 +61,7 @@ class ModuleClones : public Module
  private:
        CommandClones cmd;
  public:
-       ModuleClones(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleClones(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 1520c9df4f063045180599e69e9dc2f5cfab45e6..9514cd80990bc51d57b4014993397c66a4d324cc 100644 (file)
@@ -29,9 +29,8 @@ class CommandClose : public Command
 {
  public:
        /* Command 'close', needs operator */
-       CommandClose (InspIRCd* Instance) : Command(Instance,"CLOSE", "o", 0)
+       CommandClose (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CLOSE", "o", 0)
        {
-               this->source = "m_close.so";
        }
 
        CmdResult Handle (const std::vector<std::string> &parameters, User *user)
@@ -68,7 +67,7 @@ class ModuleClose : public Module
        CommandClose cmd;
  public:
        ModuleClose(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 1e84719554a7151c95b525faa70a1970b4a98dd0..4aa420d1fb08ce1a51f6f067dcad05a23c555a88 100644 (file)
@@ -20,7 +20,7 @@
 class PrivacyMode : public ModeHandler
 {
  public:
-       PrivacyMode(InspIRCd* Instance) : ModeHandler(Instance, 'c', 0, 0, false, MODETYPE_USER, false) { }
+       PrivacyMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'c', 0, 0, false, MODETYPE_USER, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -49,7 +49,7 @@ class ModulePrivacyMode : public Module
 {
        PrivacyMode pm;
  public:
-       ModulePrivacyMode(InspIRCd* Me) : Module(Me), pm(Me)
+       ModulePrivacyMode(InspIRCd* Me) : Module(Me), pm(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&pm))
                        throw ModuleException("Could not add new modes!");
index 499886535d1b075a2eaf524d44dab7fa04905729..806f2194f17b45a2ae15b30e047f5ad3b18f4dd8 100644 (file)
@@ -20,9 +20,8 @@
 class CommandTitle : public Command
 {
  public:
-       CommandTitle (InspIRCd* Instance) : Command(Instance,"TITLE",0,2)
+       CommandTitle (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"TITLE",0,2)
        {
-               this->source = "m_customtitle.so";
                syntax = "<user> <password>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -93,7 +92,7 @@ class ModuleCustomTitle : public Module
        CommandTitle cmd;
 
  public:
-       ModuleCustomTitle(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleCustomTitle(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
                Implementation eventlist[] = { I_OnDecodeMetaData, I_OnWhoisLine, I_OnSyncUser, I_OnUserQuit, I_OnCleanup };
index 923783e4bc49e0c3a73ee18164ec61057ef47f5b..2ba28d933905ea3b67ca22634aace6ae1f3b554d 100644 (file)
@@ -20,9 +20,8 @@
 class CommandCycle : public Command
 {
  public:
-       CommandCycle (InspIRCd* Instance) : Command(Instance,"CYCLE", 0, 1, false, 3)
+       CommandCycle (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"CYCLE", 0, 1, false, 3)
        {
-               this->source = "m_cycle.so";
                syntax = "<channel> :[reason]";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
@@ -82,7 +81,7 @@ class ModuleCycle : public Module
        CommandCycle cmd;
  public:
        ModuleCycle(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index ab6789049a836478345434cc612c8975eac7dd13..df70bba82847944d3daf3df173466da587483fad 100644 (file)
@@ -47,9 +47,8 @@ bannedfilelist bfl;
 class CommandDccallow : public Command
 {
  public:
-       CommandDccallow(InspIRCd* Me) : Command(Me, "DCCALLOW", 0, 0)
+       CommandDccallow(InspIRCd* Me, Module* parent) : Command(Me, parent, "DCCALLOW", 0, 0)
        {
-               this->source = "m_dccallow.so";
                syntax = "{[+|-]<nick> <time>|HELP|LIST}";
                /* XXX we need to fix this so it can work with translation stuff (i.e. move +- into a seperate param */
        }
@@ -248,7 +247,7 @@ class ModuleDCCAllow : public Module
  public:
 
        ModuleDCCAllow(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                Conf = new ConfigReader(ServerInstance);
                ServerInstance->AddCommand(&cmd);
index 7a810ae3174ac72b2df7c134cec050206b73569d..c3b31c873c2e7e59bf050fb1f9a70ea338ea062f 100644 (file)
@@ -20,7 +20,7 @@
 class User_d : public ModeHandler
 {
  public:
-       User_d(InspIRCd* Instance) : ModeHandler(Instance, 'd', 0, 0, false, MODETYPE_USER, false) { }
+       User_d(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'd', 0, 0, false, MODETYPE_USER, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -54,7 +54,7 @@ class ModuleDeaf : public Module
 
  public:
        ModuleDeaf(InspIRCd* Me)
-               : Module(Me), m1(Me)
+               : Module(Me), m1(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&m1))
                        throw ModuleException("Could not add new modes!");
index 8b5e83e88b5b6d3e82ced1e3929aec1ec0165857..5f5a95432b1baedeab2dda56430ea11aae8eff5b 100644 (file)
@@ -18,9 +18,8 @@ class DelayJoinMode : public ModeHandler
 {
  private:
        CUList empty;
-       Module* Creator;
  public:
-       DelayJoinMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, 'D', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@'), Creator(Parent) {};
+       DelayJoinMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, Parent, 'D', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') {};
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool);
 };
@@ -67,7 +66,7 @@ ModeAction DelayJoinMode::OnModeChange(User* source, User* dest, Channel* channe
                 */
                CUList* names = channel->GetUsers();
                for (CUListIter n = names->begin(); n != names->end(); ++n)
-                       Creator->OnText(n->first, channel, TYPE_CHANNEL, "", 0, empty);
+                       creator->OnText(n->first, channel, TYPE_CHANNEL, "", 0, empty);
        }
        channel->SetMode('D', adding);
        return MODEACTION_ALLOW;
index b732e4523f2b9ad9fa7743a5b0ce90a79417a08d..54a0f75d497f69ac5ecfcb84e86e7076c24b756a 100644 (file)
@@ -18,9 +18,8 @@ class DelayMsgMode : public ModeHandler
 {
  private:
        CUList empty;
-       Module* Creator;
  public:
-       DelayMsgMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, 'd', 1, 0, false, MODETYPE_CHANNEL, false, 0, '@'), Creator(Parent) {};
+       DelayMsgMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, Parent, 'd', 1, 0, false, MODETYPE_CHANNEL, false, 0, '@') {};
 
        ModePair ModeSet(User*, User*, Channel* channel, const std::string &parameter)
        {
index 0e6f68480d295ef1a98c56f05f0a26f8dcf5f58e..0d511886c02e3d3e51092439986a41fafd916ef3 100644 (file)
@@ -25,9 +25,8 @@
 class CommandDevoice : public Command
 {
  public:
-       CommandDevoice (InspIRCd* Instance) : Command(Instance,"DEVOICE", 0, 1)
+       CommandDevoice (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"DEVOICE", 0, 1)
        {
-               this->source = "m_devoice.so";
                syntax = "<channel>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -55,7 +54,7 @@ class ModuleDeVoice : public Module
 {
        CommandDevoice cmd;
  public:
-       ModuleDeVoice(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleDeVoice(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 6490e4c8636a04e26227ab09b7d17341e7e0d93f..3288d69fb43d161e0bee29e125f780b3d34984c7 100644 (file)
@@ -101,9 +101,9 @@ class CommandFilter : public Command
 {
        FilterBase* Base;
  public:
-       CommandFilter(FilterBase* f, InspIRCd* Me, const std::string &ssource) : Command(Me, "FILTER", "o", 1, 5), Base(f)
+       CommandFilter(FilterBase* f, InspIRCd* Me, const std::string &ssource)
+               : Command(Me, reinterpret_cast<Module*>(f), "FILTER", "o", 1, 5), Base(f)
        {
-               this->source = ssource;
                this->syntax = "<filter-definition> <action> <flags> [<gline-duration>] :<reason>";
        }
        CmdResult Handle(const std::vector<std::string>&, User*);
index a3e3148468bc7898b545ee0af6829a313e12393e..72c8a14d3b092e57be60dbdc6d3af781f6b35ef4 100644 (file)
@@ -20,9 +20,8 @@
 class CommandGloadmodule : public Command
 {
  public:
-       CommandGloadmodule (InspIRCd* Instance) : Command(Instance,"GLOADMODULE", "o", 1)
+       CommandGloadmodule (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"GLOADMODULE", "o", 1)
        {
-               this->source = "m_globalload.so";
                syntax = "<modulename> [servermask]";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
@@ -55,9 +54,8 @@ class CommandGloadmodule : public Command
 class CommandGunloadmodule : public Command
 {
  public:
-       CommandGunloadmodule (InspIRCd* Instance) : Command(Instance,"GUNLOADMODULE", "o", 1)
+       CommandGunloadmodule (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"GUNLOADMODULE", "o", 1)
        {
-               this->source = "m_globalload.so";
                syntax = "<modulename> [servermask]";
        }
 
@@ -89,9 +87,8 @@ class CommandGunloadmodule : public Command
 class CommandGreloadmodule : public Command
 {
  public:
-       CommandGreloadmodule (InspIRCd* Instance) : Command(Instance, "GRELOADMODULE", "o", 1)
+       CommandGreloadmodule (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "GRELOADMODULE", "o", 1)
        {
-               this->source = "m_globalload.so";
                syntax = "<modulename> [servermask]";
        }
 
@@ -131,7 +128,7 @@ class ModuleGlobalLoad : public Module
 
  public:
        ModuleGlobalLoad(InspIRCd* Me)
-               : Module(Me), cmd1(Me), cmd2(Me), cmd3(Me)
+               : Module(Me), cmd1(Me, this), cmd2(Me, this), cmd3(Me, this)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
index 934a4ec14f30404893a86731b7e19a0dcb26ace4..4c8b0e713e54945cf6ccf66fc4bde4c88bb76a51 100644 (file)
@@ -22,9 +22,8 @@
 class CommandGlobops : public Command
 {
  public:
-       CommandGlobops (InspIRCd* Instance) : Command(Instance,"GLOBOPS","o",1,1)
+       CommandGlobops (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"GLOBOPS","o",1,1)
        {
-               this->source = "m_globops.so";
                syntax = "<any-text>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -48,7 +47,7 @@ class ModuleGlobops : public Module
        CommandGlobops cmd;
  public:
        ModuleGlobops(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
                ServerInstance->SNO->EnableSnomask('g',"GLOBOPS");
index 4800ebac8328bc327e349bcf673f8a408114471e..1064714a2b87f7d589d3d9c243c43c9fc1cba696 100644 (file)
@@ -22,7 +22,7 @@ static std::map<irc::string, std::string> helpop_map;
 class Helpop : public ModeHandler
 {
  public:
-       Helpop(InspIRCd* Instance) : ModeHandler(Instance, 'h', 0, 0, false, MODETYPE_USER, true) { }
+       Helpop(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'h', 0, 0, false, MODETYPE_USER, true) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -52,9 +52,8 @@ class Helpop : public ModeHandler
 class CommandHelpop : public Command
 {
  public:
-       CommandHelpop (InspIRCd* Instance) : Command(Instance, "HELPOP", 0, 0)
+       CommandHelpop (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "HELPOP", 0, 0)
        {
-               this->source = "m_helpop.so";
                syntax = "<any-text>";
        }
 
@@ -119,7 +118,7 @@ class ModuleHelpop : public Module
 
        public:
                ModuleHelpop(InspIRCd* Me)
-                       : Module(Me), cmd(Me), ho(Me)
+                       : Module(Me), cmd(Me, this), ho(Me, this)
                {
                        ReadConfig();
                        if (!ServerInstance->Modes->AddMode(&ho))
index 96f5ef560911722ea96f2fc05a8beeea8846847c..137bab92b34ab770098972aead6d8ee8ea673100 100644 (file)
@@ -20,7 +20,7 @@
 class HideChans : public ModeHandler
 {
  public:
-       HideChans(InspIRCd* Instance) : ModeHandler(Instance, 'I', 0, 0, false, MODETYPE_USER, false) { }
+       HideChans(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'I', 0, 0, false, MODETYPE_USER, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -50,7 +50,7 @@ class ModuleHideChans : public Module
        bool AffectsOpers;
        HideChans hm;
  public:
-       ModuleHideChans(InspIRCd* Me) : Module(Me), hm(Me)
+       ModuleHideChans(InspIRCd* Me) : Module(Me), hm(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&hm))
                        throw ModuleException("Could not add new modes!");
index c204d51e9952a4d9db3d6c0efce821f57301e091..51d1259ed4e4f9399447abd69cff39a31c463a8d 100644 (file)
@@ -20,7 +20,7 @@
 class HideOper : public ModeHandler
 {
  public:
-       HideOper(InspIRCd* Instance) : ModeHandler(Instance, 'H', 0, 0, false, MODETYPE_USER, true) { }
+       HideOper(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'H', 0, 0, false, MODETYPE_USER, true) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -50,7 +50,7 @@ class ModuleHideOper : public Module
        HideOper hm;
  public:
        ModuleHideOper(InspIRCd* Me)
-               : Module(Me), hm(Me)
+               : Module(Me), hm(Me, this)
        {
 
                if (!ServerInstance->Modes->AddMode(&hm))
index d471b44d974f87d37869b1480d5a6b12c82ef3b2..4a3846ce45559998126ed101be49c2218359a451 100644 (file)
@@ -40,7 +40,7 @@ class InvisibleMode : public ModeHandler
 {
        QuietOper* qo;
  public:
-       InvisibleMode(InspIRCd* Instance) : ModeHandler(Instance, 'Q', 0, 0, false, MODETYPE_USER, true)
+       InvisibleMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'Q', 0, 0, false, MODETYPE_USER, true)
        {
                qo = new QuietOper();
        }
@@ -134,7 +134,7 @@ class ModuleInvisible : public Module
        InvisibleDeOper ido;
  public:
        ModuleInvisible(InspIRCd* Me)
-               : Module(Me), qm(Me), ido(Me)
+               : Module(Me), qm(Me, this), ido(Me)
        {
                conf = new ConfigReader(ServerInstance);
                if (!ServerInstance->Modes->AddMode(&qm))
index 5acdf4f97f63e0872f75b34c7f6bb88780163d45..da7f10df192ec78aa94d21098ddec13384f22a2c 100644 (file)
@@ -34,14 +34,14 @@ class InspIRCd* ServerInstance;
 class InviteException : public ListModeBase
 {
  public:
-       InviteException(InspIRCd* Instance) : ListModeBase(Instance, 'I', "End of Channel Invite Exception List", 346, 347, true) { }
+       InviteException(InspIRCd* Instance, Module* Creator) : ListModeBase(Instance, Creator, 'I', "End of Channel Invite Exception List", 346, 347, true) { }
 };
 
 class ModuleInviteException : public Module
 {
        InviteException ie;
 public:
-       ModuleInviteException(InspIRCd* Me) : Module(Me), ie(Me)
+       ModuleInviteException(InspIRCd* Me) : Module(Me), ie(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&ie))
                        throw ModuleException("Could not add new modes!");
index 31d0b4e8483c276e098b4ab666abffc5c3233cd1..ac194decdd1d7c641ff199a27f4c992990dc1e1f 100644 (file)
@@ -86,7 +86,7 @@ class joinfloodsettings : public classbase
 class JoinFlood : public ModeHandler
 {
  public:
-       JoinFlood(InspIRCd* Instance) : ModeHandler(Instance, 'j', 1, 0, false, MODETYPE_CHANNEL, false) { }
+       JoinFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'j', 1, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
        {
@@ -202,7 +202,7 @@ class ModuleJoinFlood : public Module
  public:
 
        ModuleJoinFlood(InspIRCd* Me)
-               : Module(Me), jf(Me)
+               : Module(Me), jf(Me, this)
        {
 
                if (!ServerInstance->Modes->AddMode(&jf))
index f97e64258733293e74b0958360bedcbb3c71918b..5ea4cdf8ed5a986141210d66d864a79a2ff798fc 100644 (file)
@@ -27,9 +27,8 @@ class CommandJumpserver : public Command
        std::string reason;
        int port;
 
-       CommandJumpserver (InspIRCd* Instance) : Command(Instance, "JUMPSERVER", "o", 0, 4)
+       CommandJumpserver (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "JUMPSERVER", "o", 0, 4)
        {
-               this->source = "m_jumpserver.so";
                syntax = "[<server> <port> <+/-an> <reason>]";
                redirect_to.clear();
                reason.clear();
@@ -137,7 +136,7 @@ class ModuleJumpServer : public Module
        CommandJumpserver js;
  public:
        ModuleJumpServer(InspIRCd* Me)
-               : Module(Me), js(Me)
+               : Module(Me), js(Me, this)
        {
                ServerInstance->AddCommand(&js);
                Implementation eventlist[] = { I_OnUserRegister };
index 835f73443f7ed02dc20dbe833869f18f642de65d..915480ed983084d4ac338f29afa3503e4d6becc4 100644 (file)
@@ -30,7 +30,7 @@ typedef std::map<User*, time_t> delaylist;
 class KickRejoin : public ModeHandler
 {
  public:
-       KickRejoin(InspIRCd* Instance) : ModeHandler(Instance, 'J', 1, 0, false, MODETYPE_CHANNEL, false) { }
+       KickRejoin(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'J', 1, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
        {
@@ -111,7 +111,7 @@ class ModuleKickNoRejoin : public Module
 public:
 
        ModuleKickNoRejoin(InspIRCd* Me)
-               : Module(Me), kr(Me)
+               : Module(Me), kr(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&kr))
                        throw ModuleException("Could not add new modes!");
index 45b213b40decbcb66316df819d7fa308a46a5de4..a13bd6a5cd0b660852e12b6efd74d4180d99b432 100644 (file)
@@ -20,9 +20,8 @@
 class CommandKnock : public Command
 {
  public:
-       CommandKnock (InspIRCd* Instance) : Command(Instance,"KNOCK", 0, 2)
+       CommandKnock (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"KNOCK", 0, 2)
        {
-               this->source = "m_knock.so";
                syntax = "<channel> <reason>";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
@@ -73,7 +72,7 @@ class CommandKnock : public Command
 class Knock : public SimpleChannelModeHandler
 {
  public:
-       Knock(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'K') { }
+       Knock(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'K') { }
 };
 
 class ModuleKnock : public Module
@@ -81,7 +80,7 @@ class ModuleKnock : public Module
        CommandKnock cmd;
        Knock kn;
  public:
-       ModuleKnock(InspIRCd* Me) : Module(Me), cmd(Me), kn(Me)
+       ModuleKnock(InspIRCd* Me) : Module(Me), cmd(Me, this), kn(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&kn))
                        throw ModuleException("Could not add new modes!");
index 77dc5a219dfbc762a1f2b4dfe652dc37f365e781..0a19d56df911ccc91d5c0cd49f7e790771aa7a25 100644 (file)
 
 class CommandLockserv : public Command
 {
-private:
        bool& locked;
-
 public:
-       CommandLockserv (InspIRCd* Instance, bool &lock)
-       : Command(Instance, "LOCKSERV", "o", 0), locked(lock)
+       CommandLockserv (InspIRCd* Instance, Module* Creator, bool& lock)
+               : Command(Instance, Creator, "LOCKSERV", "o", 0), locked(lock)
        {
-               this->source = "m_lockserv.so";
                syntax.clear();
        }
 
@@ -50,10 +47,9 @@ private:
        bool& locked;
 
 public:
-       CommandUnlockserv (InspIRCd* Instance, bool &lock)
-       : Command(Instance, "UNLOCKSERV", "o", 0), locked(lock)
+       CommandUnlockserv (InspIRCd* Instance, Module* Creator, bool &lock)
+               : Command(Instance, Creator, "UNLOCKSERV", "o", 0), locked(lock)
        {
-               this->source = "m_lockserv.so";
                syntax.clear();
        }
 
@@ -80,7 +76,7 @@ private:
        }
 
 public:
-       ModuleLockserv(InspIRCd* Me) : Module(Me), lockcommand(Me, locked), unlockcommand(Me, locked)
+       ModuleLockserv(InspIRCd* Me) : Module(Me), lockcommand(Me, this, locked), unlockcommand(Me, this, locked)
        {
                ResetLocked();
                ServerInstance->AddCommand(&lockcommand);
index 087d8e47ee950aadeeb3694a5cf24b1689488907..007047e1022004096f7c2f9cc1724bca68e2a4b0 100644 (file)
@@ -76,7 +76,7 @@ class floodsettings : public classbase
 class MsgFlood : public ModeHandler
 {
  public:
-       MsgFlood(InspIRCd* Instance) : ModeHandler(Instance, 'f', 1, 0, false, MODETYPE_CHANNEL, false) { }
+       MsgFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'f', 1, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
        {
@@ -197,7 +197,7 @@ class ModuleMsgFlood : public Module
  public:
 
        ModuleMsgFlood(InspIRCd* Me)
-               : Module(Me), mf(Me)
+               : Module(Me), mf(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&mf))
                        throw ModuleException("Could not add new modes!");
index edb5aff3ecfc1191944324811f1fece72234b53b..d0e4eaeb6b9efa18b2e7f8173cf20f88b212b390 100644 (file)
@@ -90,7 +90,7 @@ class nickfloodsettings : public classbase
 class NickFlood : public ModeHandler
 {
  public:
-       NickFlood(InspIRCd* Instance) : ModeHandler(Instance, 'F', 1, 0, false, MODETYPE_CHANNEL, false) { }
+       NickFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'F', 1, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
        {
@@ -205,7 +205,7 @@ class ModuleNickFlood : public Module
  public:
 
        ModuleNickFlood(InspIRCd* Me)
-               : Module(Me), jf(Me)
+               : Module(Me), jf(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&jf))
                        throw ModuleException("Could not add new modes!");
index b0f257cf9d85ff29a5da0966481f0ea642cb478a..bc5ebe47a781e0938eff921f1f972667d02950dd 100644 (file)
@@ -21,9 +21,8 @@ class CommandNicklock : public Command
 {
 
  public:
-       CommandNicklock (InspIRCd* Instance) : Command(Instance,"NICKLOCK", "o", 2)
+       CommandNicklock (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"NICKLOCK", "o", 2)
        {
-               this->source = "m_nicklock.so";
                syntax = "<oldnick> <newnick>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -92,9 +91,8 @@ class CommandNicklock : public Command
 class CommandNickunlock : public Command
 {
  public:
-       CommandNickunlock (InspIRCd* Instance) : Command(Instance,"NICKUNLOCK", "o", 1)
+       CommandNickunlock (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"NICKUNLOCK", "o", 1)
        {
-               this->source = "m_nicklock.so";
                syntax = "<locked-nick>";
                TRANSLATE2(TR_NICK, TR_END);
        }
@@ -148,11 +146,11 @@ class CommandNickunlock : public Command
 
 class ModuleNickLock : public Module
 {
-       CommandNicklock cmd1;
-       CommandNickunlock       cmd2;
+       CommandNicklock cmd1;
+       CommandNickunlock cmd2;
  public:
        ModuleNickLock(InspIRCd* Me)
-               : Module(Me), cmd1(Me), cmd2(Me)
+               : Module(Me), cmd1(Me, this), cmd2(Me, this)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
index b7d9295a10c9088068a5199d899ddbc1685f4316..6f9ddf8ededef7004282f5ec394ab705c71b2007 100644 (file)
@@ -18,7 +18,7 @@
 class NoCTCP : public ModeHandler
 {
  public:
-       NoCTCP(InspIRCd* Instance) : ModeHandler(Instance, 'C', 0, 0, false, MODETYPE_CHANNEL, false) { }
+       NoCTCP(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'C', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -51,7 +51,7 @@ class ModuleNoCTCP : public Module
  public:
 
        ModuleNoCTCP(InspIRCd* Me)
-               : Module(Me), nc(Me)
+               : Module(Me), nc(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&nc))
                        throw ModuleException("Could not add new modes!");
index ce43e576fc1a585efaef5af028fb31d63d4636e6..911b181aba8ccb9b1595a3e45dbb41e8b3501679 100644 (file)
@@ -18,7 +18,7 @@
 class NoKicks : public SimpleChannelModeHandler
 {
  public:
-       NoKicks(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'Q') { }
+       NoKicks(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'Q') { }
 };
 
 class ModuleNoKicks : public Module
@@ -27,7 +27,7 @@ class ModuleNoKicks : public Module
 
  public:
        ModuleNoKicks(InspIRCd* Me)
-               : Module(Me), nk(Me)
+               : Module(Me), nk(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&nk))
                        throw ModuleException("Could not add new modes!");
index b3b739807dc03054e0a9b874ec37df19dd975492..1a8e83795fcd9992ae657fc00f80037af0015f1f 100644 (file)
@@ -18,7 +18,7 @@
 class NoNicks : public ModeHandler
 {
  public:
-       NoNicks(InspIRCd* Instance) : ModeHandler(Instance, 'N', 0, 0, false, MODETYPE_CHANNEL, false) { }
+       NoNicks(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'N', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -47,7 +47,7 @@ class ModuleNoNickChange : public Module
 {
        NoNicks nn;
  public:
-       ModuleNoNickChange(InspIRCd* Me) : Module(Me), nn(Me)
+       ModuleNoNickChange(InspIRCd* Me) : Module(Me), nn(Me, this)
        {
                ServerInstance->Modes->AddMode(&nn);
                Implementation eventlist[] = { I_OnUserPreNick, I_On005Numeric };
index 854de29017aed1ef6fa06e59ec8f1909ed5dcebc..6d17bc85df04a453b4117d9f017dfb218082f9b4 100644 (file)
@@ -18,7 +18,7 @@
 class NoNotice : public SimpleChannelModeHandler
 {
  public:
-       NoNotice(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'T') { }
+       NoNotice(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'T') { }
 };
 
 class ModuleNoNotice : public Module
@@ -27,7 +27,7 @@ class ModuleNoNotice : public Module
  public:
 
        ModuleNoNotice(InspIRCd* Me)
-               : Module(Me), nt(Me)
+               : Module(Me), nt(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&nt))
                        throw ModuleException("Could not add new modes!");
index 8723f6ca04d15e5723f5b220f8aa7946c98bf3b3..da8f2c140cbf44f55c2d2d4ed1fb52b27982fbc8 100644 (file)
@@ -19,7 +19,7 @@ class OperChans : public ModeHandler
 {
  public:
        /* This is an oper-only mode */
-       OperChans(InspIRCd* Instance) : ModeHandler(Instance, 'O', 0, 0, false, MODETYPE_CHANNEL, true) { }
+       OperChans(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'O', 0, 0, false, MODETYPE_CHANNEL, true) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -50,7 +50,7 @@ class ModuleOperChans : public Module
        OperChans oc;
  public:
        ModuleOperChans(InspIRCd* Me)
-               : Module(Me), oc(Me)
+               : Module(Me), oc(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&oc))
                        throw ModuleException("Could not add new modes!");
index 9caa73d9101f167738fa847da73d1950deb20b7b..e3dafeff39f4a5b843593454aad6f27d19a1977f 100644 (file)
@@ -43,9 +43,8 @@ CmdResult ShowOperMOTD(User* user)
 class CommandOpermotd : public Command
 {
  public:
-       CommandOpermotd (InspIRCd* Instance) : Command(Instance,"OPERMOTD", "o", 0)
+       CommandOpermotd (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"OPERMOTD", "o", 0)
        {
-               this->source = "m_opermotd.so";
                syntax = "[<servername>]";
        }
 
@@ -78,7 +77,7 @@ class ModuleOpermotd : public Module
        }
 
        ModuleOpermotd(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                opermotd = NULL;
                ServerInstance->AddCommand(&cmd);
index 640f2c5d8dcf98a5f07b33692c365f2e0e99d0a1..d416d5699b64f6c9cce9a75a47d22bc6eb45a1b7 100644 (file)
@@ -51,7 +51,7 @@ void AddPrefixChan(User* user, Channel* channel)
 class OperPrefixMode : public ModeHandler
 {
        public:
-               OperPrefixMode(InspIRCd* Instance, char pfx) : ModeHandler(Instance, 'y', 1, 1, true, MODETYPE_CHANNEL, false, pfx, pfx, TR_NICK) { }
+               OperPrefixMode(InspIRCd* Instance, Module* Creator, char pfx) : ModeHandler(Instance, Creator, 'y', 1, 1, true, MODETYPE_CHANNEL, false, pfx, pfx, TR_NICK) { }
 
                unsigned int GetPrefixRank()
                {
@@ -113,7 +113,7 @@ class ModuleOperPrefixMode : public Module
                ConfigReader Conf(ServerInstance);
                std::string pfx = Conf.ReadValue("operprefix", "prefix", "!", 0, false);
 
-               opm = new OperPrefixMode(ServerInstance, pfx[0]);
+               opm = new OperPrefixMode(ServerInstance, this, pfx[0]);
                if ((!ServerInstance->Modes->AddMode(opm)))
                        throw ModuleException("Could not add a new mode!");
 
index e91bedd70ce4f08f63ad707535570ee55c9ad27f..761f52bc40d09df5722197b07869b717ad8448b6 100644 (file)
@@ -23,14 +23,12 @@ typedef std::map<irc::string, Module*> hashymodules;
  */
 class CommandMkpasswd : public Command
 {
-       Module* Sender;
        hashymodules &hashers;
        std::deque<std::string> &names;
  public:
-       CommandMkpasswd (InspIRCd* Instance, Module* S, hashymodules &h, std::deque<std::string> &n)
-               : Command(Instance,"MKPASSWD", 0, 2), Sender(S), hashers(h), names(n)
+       CommandMkpasswd (InspIRCd* Instance, Module* Creator, hashymodules &h, std::deque<std::string> &n)
+               : Command(Instance, Creator, "MKPASSWD", 0, 2), hashers(h), names(n)
        {
-               this->source = "m_password_hash.so";
                syntax = "<hashtype> <any-text>";
        }
 
@@ -41,9 +39,9 @@ class CommandMkpasswd : public Command
                if (x != hashers.end())
                {
                        /* Yup, reset it first (Always ALWAYS do this) */
-                       HashResetRequest(Sender, x->second).Send();
+                       HashResetRequest(creator, x->second).Send();
                        /* Now attempt to generate a hash */
-                       user->WriteServ("NOTICE %s :%s hashed password for %s is %s",user->nick.c_str(), algo, stuff, HashSumRequest(Sender, x->second, stuff).Send() );
+                       user->WriteServ("NOTICE %s :%s hashed password for %s is %s",user->nick.c_str(), algo, stuff, HashSumRequest(creator, x->second, stuff).Send() );
                }
                else if (names.empty())
                {
index 67e941d5494295bca9721fa77a3faff8b93281b5..100afea9a3694f22fe79ad21ef25a937c529d0be 100644 (file)
@@ -21,7 +21,7 @@
 class PermChannel : public ModeHandler
 {
  public:
-       PermChannel(InspIRCd* Instance) : ModeHandler(Instance, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
+       PermChannel(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool sm)
        {
@@ -80,7 +80,7 @@ class ModulePermanentChannels : public Module
        PermChannel p;
 public:
 
-       ModulePermanentChannels(InspIRCd* Me) : Module(Me), p(Me)
+       ModulePermanentChannels(InspIRCd* Me) : Module(Me), p(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&p))
                        throw ModuleException("Could not add new modes!");
index 21cb2257dc8358ba0bfbe2b11dfeb383bd3e6703..a3c0e8d1359ade1a0bd7cbfe3b163d1cd7640ee9 100644 (file)
@@ -26,9 +26,8 @@ std::string suffix;
 class CommandRandquote : public Command
 {
  public:
-       CommandRandquote (InspIRCd* Instance) : Command(Instance,"RANDQUOTE", 0, 0)
+       CommandRandquote (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"RANDQUOTE", 0, 0)
        {
-               this->source = "m_randquote.so";
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
@@ -59,7 +58,7 @@ class ModuleRandQuote : public Module
        ConfigReader *conf;
  public:
        ModuleRandQuote(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
 
                conf = new ConfigReader(ServerInstance);
index 1a5a48b00607578722ffdacc1286f1aad6cf6165..fc743402e8290abb6404365e75dce514c2f034c2 100644 (file)
@@ -20,7 +20,7 @@
 class Redirect : public ModeHandler
 {
  public:
-       Redirect(InspIRCd* Instance) : ModeHandler(Instance, 'L', 1, 0, false, MODETYPE_CHANNEL, false) { }
+       Redirect(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'L', 1, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
        {
@@ -90,7 +90,7 @@ class ModuleRedirect : public Module
  public:
 
        ModuleRedirect(InspIRCd* Me)
-               : Module(Me), re(Me)
+               : Module(Me), re(Me, this)
        {
 
                if (!ServerInstance->Modes->AddMode(&re))
index c86565b5f169661496004b8f41420f67b87e12db..49c74d9cedaaf4c254eee97d279f86580e6a54e6 100644 (file)
@@ -206,9 +206,9 @@ class RemoveBase
 class CommandRemove : public Command, public RemoveBase
 {
  public:
-       CommandRemove(InspIRCd* Instance, bool& snk) : Command(Instance, "REMOVE", 0, 2, 2, false, 0), RemoveBase(Instance, snk)
+       CommandRemove(InspIRCd* Instance, Module* Creator, bool& snk)
+               : Command(Instance, Creator, "REMOVE", 0, 2, 2, false, 0), RemoveBase(Instance, snk)
        {
-               this->source = "m_remove.so";
                syntax = "<nick> <channel> [<reason>]";
                TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END);
        }
@@ -224,9 +224,9 @@ class CommandRemove : public Command, public RemoveBase
 class CommandFpart : public Command, public RemoveBase
 {
  public:
-       CommandFpart(InspIRCd* Instance, bool& snk) : Command(Instance, "FPART", 0, 2), RemoveBase(Instance, snk)
+       CommandFpart(InspIRCd* Instance, Module* Creator, bool& snk)
+               : Command(Instance, Creator, "FPART", 0, 2), RemoveBase(Instance, snk)
        {
-               this->source = "m_remove.so";
                syntax = "<channel> <nick> [<reason>]";
        }
 
@@ -245,7 +245,7 @@ class ModuleRemove : public Module
 
  public:
        ModuleRemove(InspIRCd* Me)
-       : Module(Me), cmd1(Me, supportnokicks), cmd2(Me, supportnokicks)
+       : Module(Me), cmd1(Me, this, supportnokicks), cmd2(Me, this, supportnokicks)
        {
                ServerInstance->AddCommand(&cmd1);
                ServerInstance->AddCommand(&cmd2);
index 26c6f0ab8cdfc660b59ac4aed0e165cc223d3fd0..843470f393511b5b6975ba9fb8dd9ab847331c4d 100644 (file)
@@ -121,9 +121,8 @@ class CommandRLine : public Command
        std::string rxengine;
 
  public:
-       CommandRLine (InspIRCd* Instance) : Command(Instance,"RLINE", "o", 1, 3)
+       CommandRLine (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"RLINE", "o", 1, 3)
        {
-               this->source = "m_rline.so";
                this->syntax = "<regex> [<rline-duration>] :<reason>";
        }
 
@@ -194,7 +193,7 @@ class ModuleRLine : public Module
        std::string RegexEngine;
 
  public:
-       ModuleRLine(InspIRCd* Me) : Module(Me), r(Me), f(Me)
+       ModuleRLine(InspIRCd* Me) : Module(Me), r(Me, this), f(Me)
        {
                mymodule = this;
                OnRehash(NULL);
index 8fad7bc42d650c90353a411b6a7421fdef71b6c6..f40451dfad4e205296b21d71c81f1456ee43c63f 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSajoin : public Command
 {
  public:
-       CommandSajoin (InspIRCd* Instance) : Command(Instance,"SAJOIN", "o", 2, false, 0)
+       CommandSajoin (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SAJOIN", "o", 2, false, 0)
        {
-               this->source = "m_sajoin.so";
                syntax = "<nick> <channel>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -91,7 +90,7 @@ class ModuleSajoin : public Module
        CommandSajoin cmd;
  public:
        ModuleSajoin(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index feceeee993f8cd6b9aa429a94ec2f29e7e688017..860f181324b2344a76c5fa8eb3c7e0373c83a796 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSakick : public Command
 {
  public:
-       CommandSakick (InspIRCd* Instance) : Command(Instance,"SAKICK", "o", 2, 3, false, 0)
+       CommandSakick (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SAKICK", "o", 2, 3, false, 0)
        {
-               this->source = "m_sakick.so";
                syntax = "<channel> <nick> [reason]";
                TRANSLATE4(TR_TEXT, TR_NICK, TR_TEXT, TR_END);
        }
@@ -91,7 +90,7 @@ class ModuleSakick : public Module
        CommandSakick cmd;
  public:
        ModuleSakick(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 0011e7076a7e30dbbeb4ec9630fb797f2ef60679..ccd40a3e7a064b3817501bdbbd0ef1ac2a00942a 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSamode : public Command
 {
  public:
-       CommandSamode (InspIRCd* Instance) : Command(Instance,"SAMODE", "o", 2, false, 0)
+       CommandSamode (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SAMODE", "o", 2, false, 0)
        {
-               this->source = "m_samode.so";
                syntax = "<target> <modes> {<mode-parameters>}";
        }
 
@@ -57,7 +56,7 @@ class ModuleSaMode : public Module
        CommandSamode cmd;
  public:
        ModuleSaMode(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 180e4ba810c043b29bbf15586731993e8130aa9d..087f04948eae310196c203bbeec3c9a0d78af5a7 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSanick : public Command
 {
  public:
-       CommandSanick (InspIRCd* Instance) : Command(Instance,"SANICK", "o", 2, false, 0)
+       CommandSanick (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SANICK", "o", 2, false, 0)
        {
-               this->source = "m_sanick.so";
                syntax = "<nick> <new-nick>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -83,7 +82,7 @@ class ModuleSanick : public Module
        CommandSanick cmd;
  public:
        ModuleSanick(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index ba5387901b6087ce0ec02926aa78c7a8ced410b0..a44131129232f54a195cb5c2ba5d751715b2a905 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSapart : public Command
 {
  public:
-       CommandSapart (InspIRCd* Instance) : Command(Instance,"SAPART", "o", 2, 3, false, 0)
+       CommandSapart (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SAPART", "o", 2, 3, false, 0)
        {
-               this->source = "m_sapart.so";
                syntax = "<nick> <channel> [reason]";
                TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END);
        }
@@ -91,7 +90,7 @@ class ModuleSapart : public Module
        CommandSapart cmd;
  public:
        ModuleSapart(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 8bd1664c619ab0b32864d280af1840fee0aac37b..6f0a20f9ab20458aa17d89064da7f0f5f7479724 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSaquit : public Command
 {
  public:
-       CommandSaquit (InspIRCd* Instance) : Command(Instance, "SAQUIT", "o", 2, 2, false, 0)
+       CommandSaquit (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "SAQUIT", "o", 2, 2, false, 0)
        {
-               this->source = "m_saquit.so";
                syntax = "<nick> <reason>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -61,7 +60,7 @@ class ModuleSaquit : public Module
        CommandSaquit cmd;
  public:
        ModuleSaquit(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 08f1363741fa8ab4e3509d68dfb8428b87de6fd7..45984b2303526584531b5cfe7549052294cfb945 100644 (file)
@@ -27,7 +27,6 @@ class SaslAuthenticator : public classbase
 {
  private:
        InspIRCd *ServerInstance;
-       Module *Creator;
        std::string agent;
        User *user;
        SaslState state;
@@ -36,7 +35,7 @@ class SaslAuthenticator : public classbase
 
  public:
        SaslAuthenticator(User *user_, std::string method, InspIRCd *instance, Module *ctor)
-               : ServerInstance(instance), Creator(ctor), user(user_), state(SASL_INIT), state_announced(false)
+               : ServerInstance(instance), user(user_), state(SASL_INIT), state_announced(false)
        {
                this->user->Extend("sasl_authenticator", this);
 
@@ -158,11 +157,9 @@ class SaslAuthenticator : public classbase
 
 class CommandAuthenticate : public Command
 {
-       Module* Creator;
  public:
-       CommandAuthenticate (InspIRCd* Instance, Module* creator) : Command(Instance,"AUTHENTICATE", 0, 1, true), Creator(creator)
+       CommandAuthenticate (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "AUTHENTICATE", 0, 1, true)
        {
-               this->source = "m_sasl.so";
        }
 
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
@@ -175,7 +172,7 @@ class CommandAuthenticate : public Command
 
                        SaslAuthenticator *sasl;
                        if (!(user->GetExt("sasl_authenticator", sasl)))
-                               sasl = new SaslAuthenticator(user, parameters[0], ServerInstance, Creator);
+                               sasl = new SaslAuthenticator(user, parameters[0], ServerInstance, creator);
                        else if (sasl->SendClientMessage(parameters) == false)  // IAL abort extension --nenolod
                                delete sasl;
                }
@@ -185,11 +182,9 @@ class CommandAuthenticate : public Command
 
 class CommandSASL : public Command
 {
-       Module* Creator;
  public:
-       CommandSASL(InspIRCd* Instance, Module* creator) : Command(Instance, "SASL", 0, 2), Creator(creator)
+       CommandSASL(InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "SASL", 0, 2)
        {
-               this->source = "m_sasl.so";
                this->disabled = true; // should not be called by users
        }
 
index 7414058df495ee269b563541b40c0eb8f5143bbe..dfe1450512cbe56eb0d181162e02d855512f05e7 100644 (file)
 class CommandSATopic : public Command
 {
  public:
-       CommandSATopic (InspIRCd* Instance)
-       : Command(Instance,"SATOPIC", "o", 2, 2, false, 0)
+       CommandSATopic (InspIRCd* Instance, Module* Creator)
+               : Command(Instance,Creator,"SATOPIC", "o", 2, 2, false, 0)
        {
-               this->source = "m_satopic.so";
                syntax = "<target> <topic>";
        }
 
@@ -58,7 +57,7 @@ class ModuleSATopic : public Module
        CommandSATopic cmd;
  public:
        ModuleSATopic(InspIRCd* Me)
-       : Module(Me), cmd(Me)
+       : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 30baccadf0db10aaa6b008af4386875d8cb6d145..e32973bd08deb694bf40e27e8bd50f59ffa9f96b 100644 (file)
@@ -22,7 +22,7 @@ class Channel_r : public ModeHandler
 {
 
  public:
-       Channel_r(InspIRCd* Instance) : ModeHandler(Instance, 'r', 0, 0, false, MODETYPE_CHANNEL, false) { }
+       Channel_r(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'r', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -52,7 +52,7 @@ class User_r : public ModeHandler
 {
 
  public:
-       User_r(InspIRCd* Instance) : ModeHandler(Instance, 'r', 0, 0, false, MODETYPE_USER, false) { }
+       User_r(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'r', 0, 0, false, MODETYPE_USER, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
        {
@@ -78,7 +78,7 @@ class User_r : public ModeHandler
 class AChannel_R : public SimpleChannelModeHandler
 {
  public:
-       AChannel_R(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'R') { }
+       AChannel_R(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'R') { }
 };
 
 /** User mode +R - unidentified users cannot message
@@ -86,7 +86,7 @@ class AChannel_R : public SimpleChannelModeHandler
 class AUser_R : public SimpleUserModeHandler
 {
  public:
-       AUser_R(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'R') { }
+       AUser_R(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'R') { }
 };
 
 /** Channel mode +M - unidentified users cannot message channel
@@ -94,7 +94,7 @@ class AUser_R : public SimpleUserModeHandler
 class AChannel_M : public SimpleChannelModeHandler
 {
  public:
-       AChannel_M(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'M') { }
+       AChannel_M(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'M') { }
 };
 
 class ModuleServicesAccount : public Module
@@ -106,7 +106,7 @@ class ModuleServicesAccount : public Module
        User_r m5;
  public:
        ModuleServicesAccount(InspIRCd* Me) : Module(Me),
-               m1(Me), m2(Me), m3(Me), m4(Me), m5(Me)
+               m1(Me, this), m2(Me, this), m3(Me, this), m4(Me, this), m5(Me, this)
        {
 
                if (!ServerInstance->Modes->AddMode(&m1) || !ServerInstance->Modes->AddMode(&m2) ||
index 22aad400e11e961bc40877463a84432d8308f9c7..9a1da846514c2a6755fe21dc9ff692ccf8a42b3a 100644 (file)
@@ -20,7 +20,7 @@
 class ServProtectMode : public ModeHandler
 {
  public:
-       ServProtectMode(InspIRCd* Instance) : ModeHandler(Instance, 'k', 0, 0, false, MODETYPE_USER, true) { }
+       ServProtectMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'k', 0, 0, false, MODETYPE_USER, true) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -44,7 +44,7 @@ class ModuleServProtectMode : public Module
        ServProtectMode bm;
  public:
        ModuleServProtectMode(InspIRCd* Me)
-               : Module(Me), bm(Me)
+               : Module(Me), bm(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&bm))
                        throw ModuleException("Could not add new modes!");
index a925e75c3d734a65001b823b3351f07ca2cc22b4..8442167cfb9c4ba6c785c56fca1d3f3f25a9a5ce 100644 (file)
@@ -22,9 +22,8 @@ class CommandSethost : public Command
  private:
        char* hostmap;
  public:
-       CommandSethost (InspIRCd* Instance, char* hmap) : Command(Instance,"SETHOST","o",1), hostmap(hmap)
+       CommandSethost (InspIRCd* Instance, Module* Creator, char* hmap) : Command(Instance,Creator,"SETHOST","o",1), hostmap(hmap)
        {
-               this->source = "m_sethost.so";
                syntax = "<new-hostname>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -68,7 +67,7 @@ class ModuleSetHost : public Module
        char hostmap[256];
  public:
        ModuleSetHost(InspIRCd* Me)
-               : Module(Me), cmd(Me, hostmap)
+               : Module(Me), cmd(Me, this, hostmap)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmd);
index 7823b041b86db4c898be6e40c80c3408b7222da1..93099fc7402bb27552496b81319057d1496585af 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSetident : public Command
 {
  public:
- CommandSetident (InspIRCd* Instance) : Command(Instance,"SETIDENT", "o", 1)
+ CommandSetident (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SETIDENT", "o", 1)
        {
-               this->source = "m_setident.so";
                syntax = "<new-ident>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -60,7 +59,7 @@ class ModuleSetIdent : public Module
        CommandSetident cmd;
 
  public:
-       ModuleSetIdent(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleSetIdent(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 468102675b4f37158619caaed37a0b4a93105158..4954e14ddc8c7899e75f9de394a544248dfc2029 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSetidle : public Command
 {
  public:
-       CommandSetidle (InspIRCd* Instance) : Command(Instance,"SETIDLE", "o", 1)
+       CommandSetidle (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SETIDLE", "o", 1)
        {
-               this->source = "m_setidle.so";
                syntax = "<duration>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -52,7 +51,7 @@ class ModuleSetIdle : public Module
        CommandSetidle cmd;
  public:
        ModuleSetIdle(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 00c76c848ee1acb67a156363eb14b383b4175993..6cd94c98268b37e928cdc0f84586e5cd45e3eccf 100644 (file)
@@ -20,9 +20,8 @@
 class CommandSetname : public Command
 {
  public:
-       CommandSetname (InspIRCd* Instance) : Command(Instance,"SETNAME", 0, 1, 1)
+       CommandSetname (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SETNAME", 0, 1, 1)
        {
-               this->source = "m_setname.so";
                syntax = "<new-gecos>";
                TRANSLATE2(TR_TEXT, TR_END);
        }
@@ -57,7 +56,7 @@ class ModuleSetName : public Module
        CommandSetname cmd;
  public:
        ModuleSetName(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 7464a0d21b02f68b411133d255fd8f5b4a39ddba..bbc89a2b4ace5ec8629218ac181fd7c4662e548f 100644 (file)
@@ -20,7 +20,7 @@
 class SeeWhois : public ModeHandler
 {
  public:
-       SeeWhois(InspIRCd* Instance, bool IsOpersOnly) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_USER, IsOpersOnly) { }
+       SeeWhois(InspIRCd* Instance, Module* Creator, bool IsOpersOnly) : ModeHandler(Instance, Creator, 'W', 0, 0, false, MODETYPE_USER, IsOpersOnly) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -48,9 +48,8 @@ class SeeWhois : public ModeHandler
 class WhoisNoticeCmd : public Command
 {
  public:
-       WhoisNoticeCmd(InspIRCd* Instance) : Command(Instance,"WHOISNOTICE", 0, 1)
+       WhoisNoticeCmd(InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"WHOISNOTICE", 0, 1)
        {
-               this->source = "m_showwhois.cpp";
        }
 
        void HandleFast(User* dest, User* src)
@@ -79,13 +78,13 @@ class ModuleShowwhois : public Module
 
  public:
 
-       ModuleShowwhois(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleShowwhois(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ConfigReader conf(ServerInstance);
                bool OpersOnly = conf.ReadFlag("showwhois", "opersonly", "yes", 0);
                ShowWhoisFromOpers = conf.ReadFlag("showwhois", "showfromopers", "yes", 0);
 
-               sw = new SeeWhois(ServerInstance, OpersOnly);
+               sw = new SeeWhois(ServerInstance, this, OpersOnly);
                if (!ServerInstance->Modes->AddMode(sw))
                        throw ModuleException("Could not add new modes!");
                ServerInstance->AddCommand(&cmd);
index 8a0ca2aa3b8634b86235ca1a1964093fbc175412..9e3a035838ea1db03fd71978324ed64e548093a7 100644 (file)
@@ -87,9 +87,8 @@ class ShunFactory : public XLineFactory
 class CommandShun : public Command
 {
  public:
-       CommandShun(InspIRCd* Me) : Command(Me, "SHUN", "o", 1, 3)
+       CommandShun(InspIRCd* Me, Module* Creator) : Command(Me, Creator, "SHUN", "o", 1, 3)
        {
-               this->source = "m_shun.so";
                this->syntax = "<nick!user@hostmask> [<shun-duration>] :<reason>";
        }
 
@@ -183,7 +182,7 @@ class ModuleShun : public Module
        bool affectopers;
 
  public:
-       ModuleShun(InspIRCd* Me) : Module(Me), cmd(Me), f(Me)
+       ModuleShun(InspIRCd* Me) : Module(Me), cmd(Me, this), f(Me)
        {
                ServerInstance->XLines->RegisterFactory(&f);
                ServerInstance->AddCommand(&cmd);
index 0786c4da4fa60e274b3890fed69ff14a94a190e3..0f851f15cba9fd6966029028afea6e72fd7217e9 100644 (file)
@@ -53,9 +53,8 @@ static int SILENCE_EXCLUDE    = 0x0040; /* x  exclude this pattern  */
 class CommandSVSSilence : public Command
 {
  public:
-       CommandSVSSilence(InspIRCd* Instance) : Command(Instance,"SVSSILENCE", 0, 2)
+       CommandSVSSilence(InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SVSSILENCE", 0, 2)
        {
-               this->source = "m_silence.so";
                syntax = "<target> {[+|-]<mask> <p|c|i|n|t|a|x>}";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
        }
@@ -89,9 +88,8 @@ class CommandSilence : public Command
 {
        unsigned int& maxsilence;
  public:
-       CommandSilence (InspIRCd* Instance, unsigned int &max) : Command(Instance,"SILENCE", 0, 0), maxsilence(max)
+       CommandSilence (InspIRCd* Instance, Module* Creator, unsigned int &max) : Command(Instance, Creator, "SILENCE", 0, 0), maxsilence(max)
        {
-               this->source = "m_silence.so";
                syntax = "{[+|-]<mask> <p|c|i|n|t|a|x>}";
                TRANSLATE3(TR_TEXT, TR_TEXT, TR_END);
        }
@@ -272,7 +270,7 @@ class ModuleSilence : public Module
  public:
 
        ModuleSilence(InspIRCd* Me)
-               : Module(Me), maxsilence(32), cmdsilence(Me, maxsilence), cmdsvssilence(Me)
+               : Module(Me), maxsilence(32), cmdsilence(Me, this, maxsilence), cmdsvssilence(Me, this)
        {
                OnRehash(NULL);
                ServerInstance->AddCommand(&cmdsilence);
index 545ad3bfb73aa5750a48fe428f18044eadb99cf8..0988fe0991b3413be59b14c3f82c5bd9bbbf9ee4 100644 (file)
@@ -60,11 +60,11 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const std::ve
        }
        else
        {
-               Module* srcmodule = ServerInstance->Modules->Find(thiscmd->source);
+               Module* srcmodule = thiscmd->creator;
 
                if (srcmodule && !(srcmodule->GetVersion().Flags & VF_COMMON)) {
                        ServerInstance->Logs->Log("m_spanningtree",ERROR,"Routed command %s from non-VF_COMMON module %s",
-                               command.c_str(), thiscmd->source.c_str());
+                               command.c_str(), srcmodule->ModuleSourceFile.c_str());
                        return;
                }
        }
index 3275d057e2b3a587a714f1376603e5b8e2922036..3e084dc19bf6fc314e7209f283c4680ade131e26 100644 (file)
@@ -28,9 +28,9 @@
 
 /* $ModDep: m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h */
 
-CommandRConnect::CommandRConnect (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : Command(Instance, "RCONNECT", "o", 2), Creator(Callback), Utils(Util)
+CommandRConnect::CommandRConnect (InspIRCd* Instance, Module* Creator, SpanningTreeUtilities* Util)
+       : Command(Instance, Creator, "RCONNECT", "o", 2), Utils(Util)
 {
-       this->source = "m_spanningtree.so";
        syntax = "<remote-server-mask> <target-server-mask>";
 }
 
@@ -55,7 +55,7 @@ CmdResult CommandRConnect::Handle (const std::vector<std::string>& parameters, U
                para.push_back(parameters[1]);
                std::string cmd("CONNECT");
                std::string original_command = cmd + " " + parameters[1];
-               Creator->OnPreCommand(cmd, para, user, true, original_command);
+               creator->OnPreCommand(cmd, para, user, true, original_command);
        }
        return CMD_SUCCESS;
 }
index a9958c554ad4631042bd6d6aa8c38940456df310..f038f5c226fc62ece57f6c8388f01c251f70eb40 100644 (file)
@@ -18,7 +18,6 @@
  */
 class CommandRConnect : public Command
 {
-        Module* Creator;               /* Creator */
         SpanningTreeUtilities* Utils;  /* Utility class */
  public:
         CommandRConnect (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util);
index a5dd317528993251ea6b7d3bec83cc9f93c12523..e9c69a1d44ab7e7b812f26ead40dc2c6eba2ef9c 100644 (file)
@@ -26,9 +26,9 @@
 
 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h m_spanningtree/rsquit.h */
 
-CommandRSQuit::CommandRSQuit (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util) : Command(Instance, "RSQUIT", "o", 1), Creator(Callback), Utils(Util)
+CommandRSQuit::CommandRSQuit (InspIRCd* Instance, Module* Creator, SpanningTreeUtilities* Util)
+       : Command(Instance, Creator, "RSQUIT", "o", 1), Utils(Util)
 {
-       this->source = "m_spanningtree.so";
        syntax = "<target-server-mask> [reason]";
 }
 
index 96af641084b3565a66bd334a4cd11021d4dac0d7..92f6eb15924a7e3d6f71c87436e490be003e9378 100644 (file)
@@ -18,7 +18,6 @@
  */
 class CommandRSQuit : public Command
 {
-        Module* Creator;               /* Creator */
         SpanningTreeUtilities* Utils;  /* Utility class */
  public:
         CommandRSQuit (InspIRCd* Instance, Module* Callback, SpanningTreeUtilities* Util);
index 185df53757aaedc7a2a28510cecc61184b1ef6ed..93f2a71dbdeb152d40c939351c4d7ff26cfad0a4 100644 (file)
@@ -21,9 +21,8 @@
 class CommandSSLInfo : public Command
 {
  public:
-       CommandSSLInfo (InspIRCd* Instance) : Command(Instance,"SSLINFO", 0, 1)
+       CommandSSLInfo(InspIRCd* Instance, Module* Creator) : Command(Instance, Creator, "SSLINFO", 0, 1)
        {
-               this->source = "m_sslinfo.so";
                this->syntax = "<nick>";
        }
 
@@ -66,7 +65,7 @@ class ModuleSSLInfo : public Module
        CommandSSLInfo cmd;
  public:
        ModuleSSLInfo(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
 
index ccedd5aa29c56ca3f1434db31460039d1c3061ef..641d685443f11e0345871b91932ca4b8495ef60b 100644 (file)
@@ -22,7 +22,7 @@ static char* dummy;
 class SSLMode : public ModeHandler
 {
  public:
-       SSLMode(InspIRCd* Instance) : ModeHandler(Instance, 'z', 0, 0, false, MODETYPE_CHANNEL, false) { }
+       SSLMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'z', 0, 0, false, MODETYPE_CHANNEL, false) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
@@ -70,7 +70,7 @@ class ModuleSSLModes : public Module
 
  public:
        ModuleSSLModes(InspIRCd* Me)
-               : Module(Me), sslm(Me)
+               : Module(Me), sslm(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&sslm))
                        throw ModuleException("Could not add new modes!");
index 4c5e7c0282641cc018b2176746dcfe0b60ee1774..ce98103e1d934ffe8a1d8deb9bfab44ff52eb781 100644 (file)
@@ -20,7 +20,7 @@
 class ChannelStripColor : public SimpleChannelModeHandler
 {
  public:
-       ChannelStripColor(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'S') { }
+       ChannelStripColor(InspIRCd* Instance, Module* Creator) : SimpleChannelModeHandler(Instance, Creator, 'S') { }
 };
 
 /** Handles user mode +S
@@ -28,7 +28,7 @@ class ChannelStripColor : public SimpleChannelModeHandler
 class UserStripColor : public SimpleUserModeHandler
 {
  public:
-       UserStripColor(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'S') { }
+       UserStripColor(InspIRCd* Instance, Module* Creator) : SimpleUserModeHandler(Instance, Creator, 'S') { }
 };
 
 
@@ -39,7 +39,7 @@ class ModuleStripColor : public Module
        UserStripColor usc;
 
  public:
-       ModuleStripColor(InspIRCd* Me) : Module(Me), csc(Me), usc(Me)
+       ModuleStripColor(InspIRCd* Me) : Module(Me), csc(Me, this), usc(Me, this)
        {
                if (!ServerInstance->Modes->AddMode(&usc) || !ServerInstance->Modes->AddMode(&csc))
                        throw ModuleException("Could not add new modes!");
index eae168d6bdb08121042b5701dd60bf7cc613d5ba..e0bf5a54cba0fabe3f3085605711379cae5454b1 100644 (file)
@@ -79,9 +79,8 @@ class SVSHoldFactory : public XLineFactory
 class CommandSvshold : public Command
 {
  public:
-       CommandSvshold(InspIRCd* Me) : Command(Me, "SVSHOLD", "o", 1)
+       CommandSvshold(InspIRCd* Me, Module* Creator) : Command(Me, Creator, "SVSHOLD", "o", 1)
        {
-               this->source = "m_svshold.so";
                this->syntax = "<nickname> [<duration> :<reason>]";
                TRANSLATE4(TR_NICK, TR_TEXT, TR_TEXT, TR_END);
        }
@@ -149,7 +148,7 @@ class ModuleSVSHold : public Module
 
 
  public:
-       ModuleSVSHold(InspIRCd* Me) : Module(Me), cmd(Me), s(Me)
+       ModuleSVSHold(InspIRCd* Me) : Module(Me), cmd(Me, this), s(Me)
        {
                ServerInstance->XLines->RegisterFactory(&s);
                ServerInstance->AddCommand(&cmd);
index 9939a83a2c281e626d3d14c479d88e6ea8db76c9..75a0a4cddc238a5e21966c2bef128e7848332e52 100644 (file)
@@ -21,9 +21,8 @@ class CommandSwhois : public Command
 {
 
  public:
-       CommandSwhois (InspIRCd* Instance) : Command(Instance,"SWHOIS","o",2, 2)
+       CommandSwhois (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SWHOIS","o",2, 2)
        {
-               this->source = "m_swhois.so";
                syntax = "<nick> :<swhois>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -85,7 +84,7 @@ class ModuleSWhois : public Module
        ConfigReader* Conf;
 
  public:
-       ModuleSWhois(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleSWhois(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
 
                Conf = new ConfigReader(ServerInstance);
index 83ee05749211f4a0a6f8bb11982ca6c6da353636..7be719bd30fa03bccfe1030aabd6b0f2887729e2 100644 (file)
  */
 class CommandTaxonomy : public Command
 {
-       Module* Creator;
  public:
        /* Command 'taxonomy', takes no parameters and needs no special modes */
-       CommandTaxonomy (InspIRCd* Instance, Module* maker) : Command(Instance,"TAXONOMY", "o", 1), Creator(maker)
+       CommandTaxonomy (InspIRCd* Instance, Module* maker) : Command(Instance,maker,"TAXONOMY", "o", 1)
        {
-               this->source = "m_taxonomy.so";
                syntax = "<nickname>";
        }
 
@@ -36,7 +34,7 @@ class CommandTaxonomy : public Command
                        std::deque<std::string> list;
                        dest->GetExtList(list);
                        user->WriteNumeric(304, "" + std::string(user->nick) + ":TAXONOMY ITEMS " + std::string(dest->nick) + " " +ConvToStr(list.size()));
-                       FOREACH_MOD(I_OnSyncUser, OnSyncUser(dest, Creator, user));
+                       FOREACH_MOD(I_OnSyncUser, OnSyncUser(dest, creator, user));
                        user->WriteNumeric(304, "" + std::string(user->nick) + ":TAXONOMY END");
                }
                return CMD_LOCALONLY;
index 31896bfcba0d5e7b79d23dae56dac7e5e52dd845..c27acbd38f7abe1ab13955f9267dcc55cbdc71fd 100644 (file)
@@ -33,9 +33,8 @@ timedbans TimedBanList;
 class CommandTban : public Command
 {
  public:
-       CommandTban (InspIRCd* Instance) : Command(Instance,"TBAN", 0, 3)
+       CommandTban (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"TBAN", 0, 3)
        {
-               this->source = "m_timedbans.so";
                syntax = "<channel> <duration> <banmask>";
                TRANSLATE4(TR_TEXT, TR_TEXT, TR_TEXT, TR_END);
        }
@@ -115,7 +114,7 @@ class ModuleTimedBans : public Module
        CommandTban cmd;
  public:
        ModuleTimedBans(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
                TimedBanList.clear();
index 2ce4692bb8b8b76a6420ed3abedcd84cdecbbab7..0efd496c6207ce5a4d69556e14e086d5f061149c 100644 (file)
@@ -20,9 +20,8 @@
 class CommandTline : public Command
 {
  public:
-       CommandTline (InspIRCd* Instance) : Command(Instance,"TLINE", "o", 1)
+       CommandTline (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"TLINE", "o", 1)
        {
-               this->source = "m_tline.so";
                this->syntax = "<mask>";
        }
 
@@ -65,7 +64,7 @@ class ModuleTLine : public Module
        CommandTline cmd;
  public:
        ModuleTLine(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 2cadc852421469bec7c9fa83973688f943c6e49b..73329502934c4e6017d12c9d8432c6811ffddd80 100644 (file)
@@ -20,9 +20,8 @@
 class CommandUninvite : public Command
 {
  public:
-       CommandUninvite (InspIRCd* Instance) : Command(Instance,"UNINVITE", 0, 2)
+       CommandUninvite (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"UNINVITE", 0, 2)
        {
-               this->source = "m_uninvite.so";
                syntax = "<nick> <channel>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -83,7 +82,7 @@ class ModuleUninvite : public Module
 
  public:
 
-       ModuleUninvite(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleUninvite(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 8600546bcbfa2a2730695e9b7d962675fe87b101..75981b5cc93d19a2dffe50dbebe387bf400c2c13 100644 (file)
@@ -20,9 +20,8 @@
 class CommandUserip : public Command
 {
  public:
-       CommandUserip (InspIRCd* Instance) : Command(Instance,"USERIP", "o", 1)
+       CommandUserip (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"USERIP", "o", 1)
        {
-               this->source = "m_userip.so";
                syntax = "<nick>{,<nick>}";
        }
 
@@ -59,7 +58,7 @@ class ModuleUserIP : public Module
        CommandUserip cmd;
  public:
        ModuleUserIP(InspIRCd* Me)
-               : Module(Me), cmd(Me)
+               : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
                Implementation eventlist[] = { I_On005Numeric };
index 005177cdbca114fb7b9162f4a667d3c2184cd5ad..419b51c9b7a6f2c7565d0f8728196df136696cd4 100644 (file)
@@ -20,9 +20,8 @@
 class CommandVhost : public Command
 {
  public:
-       CommandVhost (InspIRCd* Instance) : Command(Instance,"VHOST", 0, 2)
+       CommandVhost (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"VHOST", 0, 2)
        {
-               this->source = "m_vhost.so";
                syntax = "<username> <password>";
        }
 
@@ -61,7 +60,7 @@ class ModuleVHost : public Module
        CommandVhost cmd;
 
  public:
-       ModuleVHost(InspIRCd* Me) : Module(Me), cmd(Me)
+       ModuleVHost(InspIRCd* Me) : Module(Me), cmd(Me, this)
        {
                ServerInstance->AddCommand(&cmd);
        }
index 9b98ca83badedc4b958e6ab5f3301e89b55b1b08..6d719d13d93ce795122167c6113824a1b1e86cf1 100644 (file)
@@ -103,9 +103,8 @@ watchentries* whos_watching_me;
 class CommandSVSWatch : public Command
 {
  public:
-       CommandSVSWatch (InspIRCd* Instance) : Command(Instance,"SVSWATCH", 0, 2)
+       CommandSVSWatch (InspIRCd* Instance, Module* Creator) : Command(Instance, Creator,"SVSWATCH", 0, 2)
        {
-               this->source = "m_watch.so";
                syntax = "<target> [C|L|S]|[+|-<nick>]";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
        }
@@ -251,9 +250,8 @@ class CommandWatch : public Command
                return CMD_LOCALONLY;
        }
 
-       CommandWatch (InspIRCd* Instance, unsigned int &maxwatch) : Command(Instance,"WATCH",0,0), MAX_WATCH(maxwatch)
+       CommandWatch (InspIRCd* Instance, Module* parent, unsigned int &maxwatch) : Command(Instance,parent,"WATCH",0,0), MAX_WATCH(maxwatch)
        {
-               this->source = "m_watch.so";
                syntax = "[C|L|S]|[+|-<nick>]";
                TRANSLATE2(TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
        }
@@ -373,7 +371,7 @@ class Modulewatch : public Module
 
  public:
        Modulewatch(InspIRCd* Me)
-               : Module(Me), maxwatch(32), cmdw(Me, maxwatch), sw(Me)
+               : Module(Me), maxwatch(32), cmdw(Me, this, maxwatch), sw(Me,this) 
        {
                OnRehash(NULL);
                whos_watching_me = new watchentries();