X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_timedbans.cpp;h=3783590ccd135235f0a57ef6252854e5dd2d7306;hb=2e52ff280dca14d1598b84fab7a8c2e93fa30910;hp=24b508372d0d4b16b6d8503aac78f97215d42063;hpb=71ad308979d9c9129507fdf85d4305fd12e18bea;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 24b508372..3783590cc 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -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 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); } };