]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
fix little typo in syntax hint, type => action
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index 13f9301d2048c5a140ad6df97e5ee67f42bf96b1..5ac6e70e88035b3dff5619e1bfd1a7a6d5c1b20a 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -64,7 +64,7 @@ class CommandTban : public Command
                                TimedBan T;
                                std::string channelname = parameters[0];
                                long duration = ServerInstance->Duration(parameters[1]);
-                               unsigned long expire = duration + time(NULL);
+                               unsigned long expire = duration + ServerInstance->Time();
                                if (duration < 1)
                                {
                                        user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time");
@@ -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);
        }
 };