]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
Some more to fix still, modules probably wont load correctly atm
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index a226b97472fd9f6edb476cfb607cfa50f0503f65..36adb7679ca0dcead7789cbed4da2adf5d4c0ed7 100644 (file)
@@ -30,10 +30,10 @@ timedbans TimedBanList;
 
 /** Handle /TBAN
  */
-class cmd_tban : public Command
+class CommandTban : public Command
 {
  public:
cmd_tban (InspIRCd* Instance) : Command(Instance,"TBAN", 0, 3)
CommandTban (InspIRCd* Instance) : Command(Instance,"TBAN", 0, 3)
        {
                this->source = "m_timedbans.so";
                syntax = "<channel> <duration> <banmask>";
@@ -94,7 +94,8 @@ class cmd_tban : public Command
                                }
                                return CMD_FAILURE;
                        }
-                       else user->WriteServ("482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, channel->name);
+                       else user->WriteServ("482 %s %s :You must be at least a%soperator to change modes on this channel",user->nick, channel->name,
+                                       ServerInstance->Config->AllowHalfop ? " half-" : " channel ");
                        return CMD_FAILURE;
                }
                user->WriteServ("401 %s %s :No such channel",user->nick, parameters[0]);
@@ -104,15 +105,17 @@ class cmd_tban : public Command
 
 class ModuleTimedBans : public Module
 {
-       cmd_tban* mycommand;
+       CommandTban* mycommand;
  public:
        ModuleTimedBans(InspIRCd* Me)
                : Module(Me)
        {
                
-               mycommand = new cmd_tban(ServerInstance);
+               mycommand = new CommandTban(ServerInstance);
                ServerInstance->AddCommand(mycommand);
                TimedBanList.clear();
+               Implementation eventlist[] = { I_OnDelBan, I_OnBackgroundTimer };
+               ServerInstance->Modules->Attach(eventlist, this, 2);
        }
        
        virtual ~ModuleTimedBans()