]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_dccallow.cpp
Add comments
[user/henk/code/inspircd.git] / src / modules / m_dccallow.cpp
index ebd3b863082afe17391de8f426489c4083eb4661..7ac1bc73756389c97a0b063cb4955fc5aab82126 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -44,10 +44,10 @@ dccallowlist* dl;
 typedef std::vector<BannedFileList> bannedfilelist;
 bannedfilelist bfl;
 
-class cmd_dccallow : public Command
+class CommandDccallow : public Command
 {
  public:
-       cmd_dccallow(InspIRCd* Me) : Command(Me, "DCCALLOW", 0, 0)
+       CommandDccallow(InspIRCd* Me) : Command(Me, "DCCALLOW", 0, 0)
        {
                this->source = "m_dccallow.so";
                syntax = "{[+|-]<nick> <time>|HELP|LIST}";
@@ -245,22 +245,20 @@ class cmd_dccallow : public Command
        
 class ModuleDCCAllow : public Module
 {
-       cmd_dccallow* mycommand;
+       CommandDccallow* mycommand;
  public:
 
        ModuleDCCAllow(InspIRCd* Me)
                : Module(Me)
        {
                Conf = new ConfigReader(ServerInstance);
-               mycommand = new cmd_dccallow(ServerInstance);
+               mycommand = new CommandDccallow(ServerInstance);
                ServerInstance->AddCommand(mycommand);
                ReadFileConf();
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserQuit, I_OnUserPreNick, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 5);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnUserQuit] = List[I_OnUserPreNick] = List[I_OnRehash] = 1;
-       }
 
        virtual void OnRehash(User* user, const std::string &parameter)
        {