]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_kicknorejoin.cpp
Remove calls to ListModeBase::OnCleanup (deprecated, empty function)
[user/henk/code/inspircd.git] / src / modules / m_kicknorejoin.cpp
index 037dc5678ee09fe11732d255cd2c17e94aa1bbec..7abb9be7bbab4f09f123c06268d0d801e8876303 100644 (file)
@@ -1,16 +1,28 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Pippijn van Steenhoven <pip88nl@gmail.com>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006-2007 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2006 John Brooks <john.brooks@dereferenced.net>
+ *   Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
 
 /* $ModDesc: Provides channel mode +J (delay rejoin after kick) */
@@ -74,8 +86,9 @@ public:
                                        {
                                                if (iter->first == user)
                                                {
+                                                       std::string modeparam = chan->GetModeParameter(&kr);
                                                        user->WriteNumeric(ERR_DELAYREJOIN, "%s %s :You must wait %s seconds after being kicked to rejoin (+J)",
-                                                               user->nick.c_str(), chan->name.c_str(), chan->GetModeParameter(&kr).c_str());
+                                                               user->nick.c_str(), chan->name.c_str(), modeparam.c_str());
                                                        return MOD_RES_DENY;
                                                }
                                        }
@@ -101,12 +114,12 @@ public:
                if (memb->chan->IsModeSet(&kr) && (source != memb->user))
                {
                        delaylist* dl = kr.ext.get(memb->chan);
-                       if (dl)
+                       if (!dl)
                        {
                                dl = new delaylist;
                                kr.ext.set(memb->chan, dl);
                        }
-                       (*dl)[memb->user] = ServerInstance->Time() + atoi(memb->chan->GetModeParameter(&kr).c_str());
+                       (*dl)[memb->user] = ServerInstance->Time() + ConvToInt(memb->chan->GetModeParameter(&kr));
                }
        }
 
@@ -116,7 +129,7 @@ public:
 
        Version GetVersion()
        {
-               return Version("Channel mode to delay rejoin after kick", VF_COMMON | VF_VENDOR);
+               return Version("Channel mode to delay rejoin after kick", VF_VENDOR);
        }
 };