Basic multithreading support
[clinton/bobotpp.git] / source / Channel.C
index 3fd751c..ab45ba5 100644 (file)
@@ -1,6 +1,6 @@
 // Channel.C  -*- C++ -*-
 // Copyright (c) 1997, 1998 Etienne BERNARD
-// Copyright (C) 2002 Clinton Ebadi
+// Copyright (C) 2002,2005,2008 Clinton Ebadi
 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
+#include <cstdlib>
+
 #include "Macros.H"
 #include "Utils.H"
 #include "Channel.H"
@@ -198,7 +201,7 @@ Channel::parseMode(Person *from, String mode)
 {
   char sign = '-';
   StringTokenizer st(mode);
-  String m = st.nextToken(), n;
+  String m = st.next_token(), n;
   User *u = 0;
   if (from)
     u = getUser(from->getNick());
@@ -275,11 +278,11 @@ Channel::parseMode(Person *from, String mode)
         else
           cnx->queue->sendChannelMode(channelName, "-l", "");
       }
-      channelLimit = (sign == '+' ? atoi(st.nextToken()) :
+      channelLimit = (sign == '+' ? std::atoi(st.next_token().c_str()) :
                       channelLimit = 0);
       break;
     case 'k':
-      channelKey = st.nextToken();
+      channelKey = st.next_token();
       if (keepModes.find('k') != -1 && doNotObey) {
         if (sign == '-' && wantedModes.find('k') != -1)
           cnx->queue->sendChannelMode(channelName, "+k", channelKey);
@@ -290,7 +293,7 @@ Channel::parseMode(Person *from, String mode)
                                                String(""));
       break;
     case 'o':
-      n = st.nextToken();
+      n = st.next_token();
       u = getUser(n);
       if (joined)
         sign == '+' ? countOp++ : countOp--;
@@ -324,12 +327,12 @@ Channel::parseMode(Person *from, String mode)
       }
       break;
     case 'v':
-      u = getUser(st.nextToken());
+      u = getUser(st.next_token());
       u->mode = (sign == '+' ? u->mode |= User::VOICE_MODE :
                  u->mode &= ~User::VOICE_MODE);
       break;
     case  'b':
-      String m = st.nextToken();
+      String m = st.next_token();
       sign == '+' ? addBan(m) : delBan(m);
       if (sign == '-') {
         ShitEntry * se =