X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_timedbans.cpp;h=a10f90819e47580efda2db5026fa89b122a33523;hb=be609949e3ec2543d6cb16d23240870028732f36;hp=d69533846fd5839032bfe78e6b84824be19d6d76;hpb=e3bd782207f50d131acd008b0cbcc7545aac7690;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index d69533846..a10f90819 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -55,7 +55,7 @@ class CommandTban : public Command } for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++) { - if (!strcasecmp(i->data,parameters[2].c_str())) + if (!strcasecmp(i->data.c_str(), parameters[2].c_str())) { user->WriteServ("NOTICE "+std::string(user->nick)+" :The ban "+parameters[2]+" is already on the banlist of "+parameters[0]); return CMD_FAILURE; @@ -81,7 +81,7 @@ class CommandTban : public Command /* Check if the ban was actually added (e.g. banlist was NOT full) */ bool was_added = false; for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++) - if (!strcasecmp(i->data,mask.c_str())) + if (!strcasecmp(i->data.c_str(), mask.c_str())) was_added = true; if (was_added) { @@ -90,14 +90,14 @@ class CommandTban : public Command T.mask = mask; T.expire = expire; TimedBanList.push_back(T); - channel->WriteAllExcept(user, true, '@', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name, user->nick.c_str(), mask.c_str(), duration); + channel->WriteAllExcept(user, true, '@', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); if (ServerInstance->Config->AllowHalfop) - channel->WriteAllExcept(user, true, '%', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name, user->nick.c_str(), mask.c_str(), duration); + channel->WriteAllExcept(user, true, '%', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); return CMD_SUCCESS; } return CMD_FAILURE; } - else user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), channel->name, + else user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), channel->name.c_str(), ServerInstance->Config->AllowHalfop ? " half-" : " channel "); return CMD_FAILURE; } @@ -113,14 +113,14 @@ class ModuleTimedBans : public Module ModuleTimedBans(InspIRCd* Me) : Module(Me) { - + mycommand = new CommandTban(ServerInstance); ServerInstance->AddCommand(mycommand); TimedBanList.clear(); Implementation eventlist[] = { I_OnDelBan, I_OnBackgroundTimer }; ServerInstance->Modules->Attach(eventlist, this, 2); } - + virtual ~ModuleTimedBans() { TimedBanList.clear(); @@ -129,7 +129,7 @@ class ModuleTimedBans : public Module virtual int OnDelBan(User* source, Channel* chan, const std::string &banmask) { irc::string listitem = banmask.c_str(); - irc::string thischan = chan->name; + irc::string thischan = chan->name.c_str(); for (timedbans::iterator i = TimedBanList.begin(); i < TimedBanList.end(); i++) { irc::string target = i->mask.c_str(); @@ -164,9 +164,9 @@ class ModuleTimedBans : public Module setban.push_back(mask); CUList empty; - cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name, safei->mask.c_str()); + cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name.c_str(), safei->mask.c_str()); if (ServerInstance->Config->AllowHalfop) - cr->WriteAllExcept(ServerInstance->FakeClient, true, '%', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name, safei->mask.c_str()); + cr->WriteAllExcept(ServerInstance->FakeClient, true, '%', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name.c_str(), safei->mask.c_str()); /* Removes the ban item for us, no ::erase() needed */ ServerInstance->PI->SendModeStr(safei->channel, std::string("-b ") + setban[2]); @@ -183,10 +183,10 @@ class ModuleTimedBans : public Module } } } - + virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } };