]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
Add extra parameter to OnUserPreNotice and OnUserPrePrivmsg, CUList &exempt_list...
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index 24b508372d0d4b16b6d8503aac78f97215d42063..3783590ccd135235f0a57ef6252854e5dd2d7306 100644 (file)
@@ -23,14 +23,13 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-
 #include "hashcomp.h"
 #include "configreader.h"
 #include "inspircd.h"
 
 
-
-
+/** Holds a timed ban
+ */
 class TimedBan : public classbase
 {
  public:
@@ -42,6 +41,8 @@ class TimedBan : public classbase
 typedef std::vector<TimedBan> timedbans;
 timedbans TimedBanList;
 
+/** Handle /TBAN
+ */
 class cmd_tban : public command_t
 {
  public:
@@ -64,10 +65,13 @@ class cmd_tban : public command_t
                                        user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban mask");
                                        return CMD_FAILURE;
                                }
-                               if (channel->IsBanned(user))
+                               for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++)
                                {
-                                       user->WriteServ("NOTICE "+std::string(user->nick)+" :The ban "+std::string(parameters[2])+" is already on the banlist of "+std::string(parameters[0]));
-                                       return CMD_FAILURE;
+                                       if (!strcasecmp(i->data,parameters[2]))
+                                       {
+                                               user->WriteServ("NOTICE "+std::string(user->nick)+" :The ban "+std::string(parameters[2])+" is already on the banlist of "+std::string(parameters[0]));
+                                               return CMD_FAILURE;
+                                       }
                                }
                                TimedBan T;
                                std::string channelname = parameters[0];
@@ -201,7 +205,7 @@ class ModuleTimedBans : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0,VF_VENDOR);
+               return Version(1,1,0,0,VF_VENDOR,API_VERSION);
        }
 };