]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
Fix various rline bugs, implement /stats R, and fix the issue where you get no error...
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index d69533846fd5839032bfe78e6b84824be19d6d76..a10f90819e47580efda2db5026fa89b122a33523 100644 (file)
@@ -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);
        }
 };